@searchability/admin-client 0.0.24 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0xf73ad5,_0xe0ab2a,_0x3ded5a,_0x475bae){function _0x34ed1c(_0x4d758c){return _0x4d758c instanceof _0x3ded5a?_0x4d758c:new _0x3ded5a(function(_0x900964){_0x900964(_0x4d758c);});}return new(_0x3ded5a||(_0x3ded5a=Promise))(function(_0x3bd034,_0x18fa73){function _0xe5ff04(_0x251a6f){try{_0x29685b(_0x475bae['next'](_0x251a6f));}catch(_0x49ef89){_0x18fa73(_0x49ef89);}}function _0x2167a6(_0x43591d){try{_0x29685b(_0x475bae['throw'](_0x43591d));}catch(_0x5322f1){_0x18fa73(_0x5322f1);}}function _0x29685b(_0x304b96){_0x304b96['done']?_0x3bd034(_0x304b96['value']):_0x34ed1c(_0x304b96['value'])['then'](_0xe5ff04,_0x2167a6);}_0x29685b((_0x475bae=_0x475bae['apply'](_0xf73ad5,_0xe0ab2a||[]))['next']());});};class TokenManager{constructor(_0x2c3349){this['authClient']=_0x2c3349;}['getOrRefreshTokens'](_0x234eb8){return __awaiter$5(this,void 0,void 0,function*(){if(Date['now']()<_0x234eb8['access_expires'])return new SuccessfulAuthResponse(_0x234eb8);if(Date['now']()<_0x234eb8['refresh_expires'])return yield this['authClient']['refresh'](_0x234eb8['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
2
+
3
+ class Response{constructor(_0xf57ed3){this['isSuccess']=_0xf57ed3;}}class SuccessfulAccountResponse extends Response{constructor(_0x43767c){super(!![]),this['account']=_0x43767c;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x59dcb0){super(![]),this['problem']=_0x59dcb0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x1151f8){super(!![]),this['tokens']=_0x1151f8;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x2dcdec){super(![]),this['problem']=_0x2dcdec;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x39609c){super(!![]),this['apiKey']=_0x39609c;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x15e9e0){super(![]),this['problem']=_0x15e9e0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x6ef013){super(!![]),this['apiKeyValue']=_0x6ef013;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyValueResponse extends Response{constructor(_0x3e0157){super(![]),this['problem']=_0x3e0157;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
+
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x25659e,_0x76c28f,_0x14e822,_0x110a85){function _0x5bae39(_0xe6b706){return _0xe6b706 instanceof _0x14e822?_0xe6b706:new _0x14e822(function(_0x1f95be){_0x1f95be(_0xe6b706);});}return new(_0x14e822||(_0x14e822=Promise))(function(_0x329844,_0x2c9e5e){function _0x1bc341(_0x3aab8f){try{_0x35bb36(_0x110a85['next'](_0x3aab8f));}catch(_0x12196a){_0x2c9e5e(_0x12196a);}}function _0x49e454(_0x51ea70){try{_0x35bb36(_0x110a85['throw'](_0x51ea70));}catch(_0x4a4766){_0x2c9e5e(_0x4a4766);}}function _0x35bb36(_0x387c6b){_0x387c6b['done']?_0x329844(_0x387c6b['value']):_0x5bae39(_0x387c6b['value'])['then'](_0x1bc341,_0x49e454);}_0x35bb36((_0x110a85=_0x110a85['apply'](_0x25659e,_0x76c28f||[]))['next']());});};class AccountService{constructor(_0x1719ea){this['fetch']=_0x1719ea;}['get'](_0x384c4e,_0x398c4c){return __awaiter$4(this,void 0,void 0,function*(){const _0x993f54='Account/'+_0x384c4e+'/',_0x4bdfdc=yield this['fetch']['get'](_0x993f54,_0x398c4c);try{if(_0x4bdfdc['status']>0xc7&&_0x4bdfdc['status']<0x12c){const _0x32d6eb=yield _0x4bdfdc['json']();return new SuccessfulAccountResponse(_0x32d6eb);}const _0x1f402f=yield _0x4bdfdc['json']();return new FailedAccountResponse(_0x1f402f);}catch(_0x34e188){if(_0x34e188 instanceof Error)return new FailedAccountResponse({'detail':_0x34e188['message'],'title':_0x34e188['name'],'status':0x1f4,'instance':'','type':''});throw _0x34e188;}});}}
6
+
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x193ec6,_0x39c5d1,_0x85e8aa,_0x322080){function _0x4774c4(_0x4b584c){return _0x4b584c instanceof _0x85e8aa?_0x4b584c:new _0x85e8aa(function(_0x30ea87){_0x30ea87(_0x4b584c);});}return new(_0x85e8aa||(_0x85e8aa=Promise))(function(_0x50744b,_0x178c06){function _0x4b8879(_0x34b591){try{_0xa7140b(_0x322080['next'](_0x34b591));}catch(_0x275331){_0x178c06(_0x275331);}}function _0x435460(_0x47f341){try{_0xa7140b(_0x322080['throw'](_0x47f341));}catch(_0x5a5e2){_0x178c06(_0x5a5e2);}}function _0xa7140b(_0x82df67){_0x82df67['done']?_0x50744b(_0x82df67['value']):_0x4774c4(_0x82df67['value'])['then'](_0x4b8879,_0x435460);}_0xa7140b((_0x322080=_0x322080['apply'](_0x193ec6,_0x39c5d1||[]))['next']());});};class ApiKeyService{constructor(_0x25ad42){this['fetch']=_0x25ad42;}['create'](_0x2bfdf8,_0x340ff9,_0x21f330){return __awaiter$3(this,void 0,void 0,function*(){const _0x21a129='api-key/create',_0x42bc69={'account_name':_0x2bfdf8,'api_key_name':_0x340ff9};try{const _0x719364=yield this['fetch']['post'](_0x21a129,_0x21f330,_0x42bc69);if(_0x719364['status']>0xc7&&_0x719364['status']<0x12c){const _0x304419=yield _0x719364['json']();return new SuccessfulApiKeyResponse(_0x304419);}const _0x3f3017=yield _0x719364['json']();return new FailedApiKeyResponse(_0x3f3017);}catch(_0x2505b3){if(_0x2505b3 instanceof Error)return new FailedApiKeyResponse({'detail':_0x2505b3['message'],'title':_0x2505b3['name'],'status':0x1f4,'instance':'','type':''});throw _0x2505b3;}});}['view'](_0x81fc9c,_0x4fb749,_0x5985ce){return __awaiter$3(this,void 0,void 0,function*(){const _0x44a949='api-key/'+_0x81fc9c+'/'+_0x4fb749;try{const _0x1aaac9=yield this['fetch']['get'](_0x44a949,_0x5985ce);if(_0x1aaac9['status']>0xc7&&_0x1aaac9['status']<0x12c){const _0x2b7b3a=yield _0x1aaac9['json']();return new SuccessfulApiKeyValueResponse(_0x2b7b3a);}const _0x35a09e=yield _0x1aaac9['json']();return new FailedApiKeyValueResponse(_0x35a09e);}catch(_0x4fa96c){if(_0x4fa96c instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x4fa96c['message'],'title':_0x4fa96c['name'],'status':0x1f4,'instance':'','type':''});throw _0x4fa96c;}});}}
8
+
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2a04c1,_0xe991a9,_0x49fcf8,_0x1b38e2){function _0x8b3e88(_0x20bf8f){return _0x20bf8f instanceof _0x49fcf8?_0x20bf8f:new _0x49fcf8(function(_0x43af8e){_0x43af8e(_0x20bf8f);});}return new(_0x49fcf8||(_0x49fcf8=Promise))(function(_0x2b9c45,_0x12537d){function _0x5625e3(_0x5475dc){try{_0x58c80a(_0x1b38e2['next'](_0x5475dc));}catch(_0x46e04c){_0x12537d(_0x46e04c);}}function _0x1791ed(_0x576008){try{_0x58c80a(_0x1b38e2['throw'](_0x576008));}catch(_0x3e9182){_0x12537d(_0x3e9182);}}function _0x58c80a(_0x17c438){_0x17c438['done']?_0x2b9c45(_0x17c438['value']):_0x8b3e88(_0x17c438['value'])['then'](_0x5625e3,_0x1791ed);}_0x58c80a((_0x1b38e2=_0x1b38e2['apply'](_0x2a04c1,_0xe991a9||[]))['next']());});};class ListService{constructor(_0x42c794){this['fetch']=_0x42c794;}['add'](_0x30147a,_0x51dcb9,_0x59d810){return __awaiter$2(this,void 0,void 0,function*(){const _0x39ac6d='List',_0xb503fc={'account_name':_0x30147a,'list_name':_0x51dcb9};try{const _0x446ca3=yield this['fetch']['post'](_0x39ac6d,_0x59d810,_0xb503fc);if(_0x446ca3['status']>0xc7&&_0x446ca3['status']<0x12c){const _0x4eb6f9=yield _0x446ca3['json']();return new SuccessfulAccountResponse(_0x4eb6f9);}const _0x52551e=yield _0x446ca3['json']();return new FailedAccountResponse(_0x52551e);}catch(_0x4ab7ef){if(_0x4ab7ef instanceof Error)return new FailedAccountResponse({'detail':_0x4ab7ef['message'],'title':_0x4ab7ef['name'],'status':0x1f4,'instance':'','type':''});throw _0x4ab7ef;}});}['remove'](_0x2fe2c7,_0x2dce93,_0x562cb7){return __awaiter$2(this,void 0,void 0,function*(){const _0x114616='List/'+_0x2fe2c7+'/'+_0x2dce93,_0x467fd5=yield this['fetch']['delete'](_0x114616,_0x562cb7);try{if(_0x467fd5['status']>0xc7&&_0x467fd5['status']<0x12c){const _0x3499db=yield _0x467fd5['json']();return new SuccessfulAccountResponse(_0x3499db);}const _0x5562e4=yield _0x467fd5['json']();return new FailedAccountResponse(_0x5562e4);}catch(_0x4c3481){if(_0x4c3481 instanceof Error)return new FailedAccountResponse({'detail':_0x4c3481['message'],'title':_0x4c3481['name'],'status':0x1f4,'instance':'','type':''});throw _0x4c3481;}});}}
10
+
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x7993d5,_0x56c5d7,_0x19edc8,_0x67be32){function _0x57eab8(_0x1ba5e9){return _0x1ba5e9 instanceof _0x19edc8?_0x1ba5e9:new _0x19edc8(function(_0x66f8b8){_0x66f8b8(_0x1ba5e9);});}return new(_0x19edc8||(_0x19edc8=Promise))(function(_0x3bdaa9,_0x22b98d){function _0x522eee(_0x44ac40){try{_0x8ba57(_0x67be32['next'](_0x44ac40));}catch(_0x10a044){_0x22b98d(_0x10a044);}}function _0x1fc232(_0x1a0333){try{_0x8ba57(_0x67be32['throw'](_0x1a0333));}catch(_0x3ee8e5){_0x22b98d(_0x3ee8e5);}}function _0x8ba57(_0x527dfd){_0x527dfd['done']?_0x3bdaa9(_0x527dfd['value']):_0x57eab8(_0x527dfd['value'])['then'](_0x522eee,_0x1fc232);}_0x8ba57((_0x67be32=_0x67be32['apply'](_0x7993d5,_0x56c5d7||[]))['next']());});};class Fetch{constructor(_0x4b1db5){this['baseUri']=_0x4b1db5,this['getUrl']=_0x4b44eb=>{return _0x4b44eb['startsWith']('/')&&(_0x4b44eb=_0x4b44eb['replace']('/','')),''+this['baseUri']+_0x4b44eb;},!_0x4b1db5['endsWith']('/')&&(_0x4b1db5=_0x4b1db5+'/');}['get'](_0x27bcdf,_0x48678a){return __awaiter$1(this,void 0,void 0,function*(){const _0x2c9129=this['getUrl'](_0x27bcdf);return yield fetch(_0x2c9129,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x48678a}});});}['post'](_0x5df98f,_0x191394,_0x373dcf){return __awaiter$1(this,void 0,void 0,function*(){const _0x245f5e=this['getUrl'](_0x5df98f);return yield fetch(_0x245f5e,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x191394},'body':_0x373dcf?JSON['stringify'](_0x373dcf):null});});}['put'](_0x340e82,_0x1a037c,_0x239294){return __awaiter$1(this,void 0,void 0,function*(){const _0x7d2306=this['getUrl'](_0x340e82);return yield fetch(_0x7d2306,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1a037c},'body':_0x239294?JSON['stringify'](_0x239294):null});});}['delete'](_0xda0196,_0x8a1c81){return __awaiter$1(this,void 0,void 0,function*(){const _0x653504=this['getUrl'](_0xda0196);return yield fetch(_0x653504,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x8a1c81}});});}}
12
+
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x13bace,_0x4ddaa5,_0x52d295,_0x3e826a){function _0x4f8742(_0x101d55){return _0x101d55 instanceof _0x52d295?_0x101d55:new _0x52d295(function(_0x5e77ca){_0x5e77ca(_0x101d55);});}return new(_0x52d295||(_0x52d295=Promise))(function(_0x1ff13d,_0x2a7cfb){function _0x45c6de(_0x1cb7c7){try{_0x1e031f(_0x3e826a['next'](_0x1cb7c7));}catch(_0x372223){_0x2a7cfb(_0x372223);}}function _0x1907dd(_0x4d9d88){try{_0x1e031f(_0x3e826a['throw'](_0x4d9d88));}catch(_0x5a0fa4){_0x2a7cfb(_0x5a0fa4);}}function _0x1e031f(_0x5b557a){_0x5b557a['done']?_0x1ff13d(_0x5b557a['value']):_0x4f8742(_0x5b557a['value'])['then'](_0x45c6de,_0x1907dd);}_0x1e031f((_0x3e826a=_0x3e826a['apply'](_0x13bace,_0x4ddaa5||[]))['next']());});};class AdminClient{constructor(_0x4f574a='https://admin.searchability.dev/'){var _0x5cdd24=new Fetch(_0x4f574a);this['Accounts']=new AccountService(_0x5cdd24),this['Lists']=new ListService(_0x5cdd24),this['ApiKeys']=new ApiKeyService(_0x5cdd24);}}class AuthClient{constructor(_0x1e2ccf='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1e2ccf);}['login'](_0x1a14af){return __awaiter(this,void 0,void 0,function*(){var _0x3d2048='login/'+_0x1a14af;try{const _0x101114=yield yield fetch(_0x3d2048);if(_0x101114['status']>0xc7&&_0x101114['status']<0x12c){const _0x1f1360=yield _0x101114['json']();return new SuccessfulAuthResponse(_0x1f1360);}const _0x4c270d=yield _0x101114['json']();return new FailedAuthResponse(_0x4c270d);}catch(_0x44e3de){if(_0x44e3de instanceof Error)return new FailedAuthResponse({'detail':_0x44e3de['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x44e3de;}});}['refresh'](_0x5aee77){return __awaiter(this,void 0,void 0,function*(){var _0x2fc6b5='refresh';try{const _0x3bca51=yield this['fetch']['post'](_0x2fc6b5,_0x5aee77,null);if(_0x3bca51['status']>0xc7&&_0x3bca51['status']<0x12c){const _0x12267b=yield _0x3bca51['json']();return new SuccessfulAuthResponse(_0x12267b);}const _0xefd43b=yield _0x3bca51['json']();return new FailedAuthResponse(_0xefd43b);}catch(_0x200f52){if(_0x200f52 instanceof Error)return new FailedAuthResponse({'detail':_0x200f52['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x200f52;}});}}
14
+
15
+ export { AdminClient, AuthClient, TokenManager };
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x255288,_0x566112,_0x104399,_0x9b6b06){function _0x594b22(_0x12c362){return _0x12c362 instanceof _0x104399?_0x12c362:new _0x104399(function(_0x61ac65){_0x61ac65(_0x12c362);});}return new(_0x104399||(_0x104399=Promise))(function(_0x38757c,_0x2a08dc){function _0x1d0325(_0x2d2f55){try{_0x163c76(_0x9b6b06['next'](_0x2d2f55));}catch(_0xc5e590){_0x2a08dc(_0xc5e590);}}function _0x21ffbe(_0x3da80b){try{_0x163c76(_0x9b6b06['throw'](_0x3da80b));}catch(_0x1e1fb8){_0x2a08dc(_0x1e1fb8);}}function _0x163c76(_0x423f00){_0x423f00['done']?_0x38757c(_0x423f00['value']):_0x594b22(_0x423f00['value'])['then'](_0x1d0325,_0x21ffbe);}_0x163c76((_0x9b6b06=_0x9b6b06['apply'](_0x255288,_0x566112||[]))['next']());});};class TokenManager{constructor(_0x21653d){this['authClient']=_0x21653d;}['getOrRefreshTokens'](_0x5b17b8){return __awaiter$5(this,void 0,void 0,function*(){if(Date['now']()<_0x5b17b8['access_expires'])return new SuccessfulAuthResponse(_0x5b17b8);if(Date['now']()<_0x5b17b8['refresh_expires'])return yield this['authClient']['refresh'](_0x5b17b8['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
3
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x3ab4d6,_0x4e133f,_0x51a3c9,_0x389c99){function _0x499632(_0x2b1ee2){return _0x2b1ee2 instanceof _0x51a3c9?_0x2b1ee2:new _0x51a3c9(function(_0x10254c){_0x10254c(_0x2b1ee2);});}return new(_0x51a3c9||(_0x51a3c9=Promise))(function(_0x3e8420,_0x419ee5){function _0x369ddf(_0x3858a2){try{_0xcbf9ae(_0x389c99['next'](_0x3858a2));}catch(_0x4855e8){_0x419ee5(_0x4855e8);}}function _0x510181(_0x386e80){try{_0xcbf9ae(_0x389c99['throw'](_0x386e80));}catch(_0x17e945){_0x419ee5(_0x17e945);}}function _0xcbf9ae(_0x19ca0b){_0x19ca0b['done']?_0x3e8420(_0x19ca0b['value']):_0x499632(_0x19ca0b['value'])['then'](_0x369ddf,_0x510181);}_0xcbf9ae((_0x389c99=_0x389c99['apply'](_0x3ab4d6,_0x4e133f||[]))['next']());});};class TokenManager{constructor(_0xf3ee38){this['authClient']=_0xf3ee38;}['getOrRefreshTokens'](_0x5baa20){return __awaiter$5(this,void 0,void 0,function*(){if(Date['now']()<_0x5baa20['access_expires'])return new SuccessfulAuthResponse(_0x5baa20);if(Date['now']()<_0x5baa20['refresh_expires'])return yield this['authClient']['refresh'](_0x5baa20['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
4
4
 
5
- class Response{constructor(_0x1cf150){this['isSuccess']=_0x1cf150;}}class SuccessfulAccountResponse extends Response{constructor(_0x2fd7af){super(!![]),this['account']=_0x2fd7af;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x16e4f6){super(![]),this['problem']=_0x16e4f6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x51d40c){super(!![]),this['tokens']=_0x51d40c;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x260d7c){super(![]),this['problem']=_0x260d7c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x1e08a4){super(!![]),this['apiKey']=_0x1e08a4;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x440b4f){super(![]),this['problem']=_0x440b4f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
5
+ class Response{constructor(_0xbc6448){this['isSuccess']=_0xbc6448;}}class SuccessfulAccountResponse extends Response{constructor(_0x421063){super(!![]),this['account']=_0x421063;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xa83850){super(![]),this['problem']=_0xa83850;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4f18c6){super(!![]),this['tokens']=_0x4f18c6;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x226fd2){super(![]),this['problem']=_0x226fd2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x21f527){super(!![]),this['apiKey']=_0x21f527;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x3acf3f){super(![]),this['problem']=_0x3acf3f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x450db8){super(!![]),this['apiKeyValue']=_0x450db8;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyValueResponse extends Response{constructor(_0x35d185){super(![]),this['problem']=_0x35d185;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
6
 
7
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x53c96e,_0x3f732d,_0x817072,_0x4e536d){function _0x1cb5a2(_0x18bfd9){return _0x18bfd9 instanceof _0x817072?_0x18bfd9:new _0x817072(function(_0x4557a8){_0x4557a8(_0x18bfd9);});}return new(_0x817072||(_0x817072=Promise))(function(_0x518e10,_0x1ccd8b){function _0x45c82e(_0x138e09){try{_0x39e65a(_0x4e536d['next'](_0x138e09));}catch(_0x15e8b2){_0x1ccd8b(_0x15e8b2);}}function _0x2a1732(_0x5eec31){try{_0x39e65a(_0x4e536d['throw'](_0x5eec31));}catch(_0x4d9fbc){_0x1ccd8b(_0x4d9fbc);}}function _0x39e65a(_0x294359){_0x294359['done']?_0x518e10(_0x294359['value']):_0x1cb5a2(_0x294359['value'])['then'](_0x45c82e,_0x2a1732);}_0x39e65a((_0x4e536d=_0x4e536d['apply'](_0x53c96e,_0x3f732d||[]))['next']());});};class AccountService{constructor(_0x15b09e){this['fetch']=_0x15b09e;}['get'](_0x266b1f,_0x2a1afe){return __awaiter$4(this,void 0,void 0,function*(){const _0x514508='Account/'+_0x266b1f+'/',_0x1f1517=yield this['fetch']['get'](_0x514508,_0x2a1afe);try{if(_0x1f1517['status']>0xc7&&_0x1f1517['status']<0x12c){const _0x2b507a=yield _0x1f1517['json']();return new SuccessfulAccountResponse(_0x2b507a);}const _0x113bfe=yield _0x1f1517['json']();return new FailedAccountResponse(_0x113bfe);}catch(_0x133985){if(_0x133985 instanceof Error)return new FailedAccountResponse({'detail':_0x133985['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x133985;}});}}
7
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x3ea4d2,_0x371b1b,_0x4809d5,_0x2f2dd9){function _0x55ebdf(_0x34f316){return _0x34f316 instanceof _0x4809d5?_0x34f316:new _0x4809d5(function(_0x2b2dbe){_0x2b2dbe(_0x34f316);});}return new(_0x4809d5||(_0x4809d5=Promise))(function(_0x54cb97,_0x287c2a){function _0x1801d0(_0x53711d){try{_0x125837(_0x2f2dd9['next'](_0x53711d));}catch(_0x414ae1){_0x287c2a(_0x414ae1);}}function _0x4afce6(_0x41564f){try{_0x125837(_0x2f2dd9['throw'](_0x41564f));}catch(_0x331846){_0x287c2a(_0x331846);}}function _0x125837(_0x3527f7){_0x3527f7['done']?_0x54cb97(_0x3527f7['value']):_0x55ebdf(_0x3527f7['value'])['then'](_0x1801d0,_0x4afce6);}_0x125837((_0x2f2dd9=_0x2f2dd9['apply'](_0x3ea4d2,_0x371b1b||[]))['next']());});};class AccountService{constructor(_0x1ab821){this['fetch']=_0x1ab821;}['get'](_0x384575,_0x3d9df4){return __awaiter$4(this,void 0,void 0,function*(){const _0x2977ab='Account/'+_0x384575+'/',_0x1eb8d3=yield this['fetch']['get'](_0x2977ab,_0x3d9df4);try{if(_0x1eb8d3['status']>0xc7&&_0x1eb8d3['status']<0x12c){const _0x3a0b4b=yield _0x1eb8d3['json']();return new SuccessfulAccountResponse(_0x3a0b4b);}const _0x42a347=yield _0x1eb8d3['json']();return new FailedAccountResponse(_0x42a347);}catch(_0x2388ab){if(_0x2388ab instanceof Error)return new FailedAccountResponse({'detail':_0x2388ab['message'],'title':_0x2388ab['name'],'status':0x1f4,'instance':'','type':''});throw _0x2388ab;}});}}
8
8
 
9
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3b7732,_0x3cf234,_0x265259,_0x345512){function _0x1b8912(_0x5f361d){return _0x5f361d instanceof _0x265259?_0x5f361d:new _0x265259(function(_0x42e847){_0x42e847(_0x5f361d);});}return new(_0x265259||(_0x265259=Promise))(function(_0x150175,_0x295d89){function _0xe39655(_0x5b2042){try{_0x24efd1(_0x345512['next'](_0x5b2042));}catch(_0x394c54){_0x295d89(_0x394c54);}}function _0x4eb3eb(_0x265635){try{_0x24efd1(_0x345512['throw'](_0x265635));}catch(_0x575827){_0x295d89(_0x575827);}}function _0x24efd1(_0x404f28){_0x404f28['done']?_0x150175(_0x404f28['value']):_0x1b8912(_0x404f28['value'])['then'](_0xe39655,_0x4eb3eb);}_0x24efd1((_0x345512=_0x345512['apply'](_0x3b7732,_0x3cf234||[]))['next']());});};class ApiKeyService{constructor(_0x3484a6){this['fetch']=_0x3484a6;}['create'](_0x3c38b8,_0x27a73f,_0x54685f){return __awaiter$3(this,void 0,void 0,function*(){const _0x5e7060='api-key/create',_0x11e58b={'account_name':_0x3c38b8,'api_key_name':_0x27a73f};try{const _0x2c6f1c=yield this['fetch']['post'](_0x5e7060,_0x54685f,_0x11e58b);if(_0x2c6f1c['status']>0xc7&&_0x2c6f1c['status']<0x12c){const _0x147b23=yield _0x2c6f1c['json']();return new SuccessfulApiKeyResponse(_0x147b23);}const _0x4543a8=yield _0x2c6f1c['json']();return new FailedApiKeyResponse(_0x4543a8);}catch(_0xf5b5f0){if(_0xf5b5f0 instanceof Error)return new FailedApiKeyResponse({'detail':_0xf5b5f0['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xf5b5f0;}});}}
9
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x4ae6c0,_0x5b3e21,_0x52222a,_0x3c50bd){function _0x51ba8f(_0x5e0789){return _0x5e0789 instanceof _0x52222a?_0x5e0789:new _0x52222a(function(_0x1d118d){_0x1d118d(_0x5e0789);});}return new(_0x52222a||(_0x52222a=Promise))(function(_0x43894f,_0x1968d3){function _0x1772ab(_0x17d132){try{_0x5421ff(_0x3c50bd['next'](_0x17d132));}catch(_0x4768a3){_0x1968d3(_0x4768a3);}}function _0x5205fb(_0x42ca1b){try{_0x5421ff(_0x3c50bd['throw'](_0x42ca1b));}catch(_0x4bcc49){_0x1968d3(_0x4bcc49);}}function _0x5421ff(_0x238760){_0x238760['done']?_0x43894f(_0x238760['value']):_0x51ba8f(_0x238760['value'])['then'](_0x1772ab,_0x5205fb);}_0x5421ff((_0x3c50bd=_0x3c50bd['apply'](_0x4ae6c0,_0x5b3e21||[]))['next']());});};class ApiKeyService{constructor(_0x203639){this['fetch']=_0x203639;}['create'](_0x3c5ecb,_0x445b7a,_0x1b0121){return __awaiter$3(this,void 0,void 0,function*(){const _0x3b69e4='api-key/create',_0x56f39d={'account_name':_0x3c5ecb,'api_key_name':_0x445b7a};try{const _0x256db9=yield this['fetch']['post'](_0x3b69e4,_0x1b0121,_0x56f39d);if(_0x256db9['status']>0xc7&&_0x256db9['status']<0x12c){const _0x293a5d=yield _0x256db9['json']();return new SuccessfulApiKeyResponse(_0x293a5d);}const _0x165f37=yield _0x256db9['json']();return new FailedApiKeyResponse(_0x165f37);}catch(_0x55395a){if(_0x55395a instanceof Error)return new FailedApiKeyResponse({'detail':_0x55395a['message'],'title':_0x55395a['name'],'status':0x1f4,'instance':'','type':''});throw _0x55395a;}});}['view'](_0x3cbfad,_0x55c813,_0x40bf25){return __awaiter$3(this,void 0,void 0,function*(){const _0x5c2353='api-key/'+_0x3cbfad+'/'+_0x55c813;try{const _0x3e9790=yield this['fetch']['get'](_0x5c2353,_0x40bf25);if(_0x3e9790['status']>0xc7&&_0x3e9790['status']<0x12c){const _0x16434b=yield _0x3e9790['json']();return new SuccessfulApiKeyValueResponse(_0x16434b);}const _0x5bb64b=yield _0x3e9790['json']();return new FailedApiKeyValueResponse(_0x5bb64b);}catch(_0x353836){if(_0x353836 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x353836['message'],'title':_0x353836['name'],'status':0x1f4,'instance':'','type':''});throw _0x353836;}});}}
10
10
 
11
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x49d1f7,_0x191808,_0x1f20b5,_0x9e9609){function _0x1c5008(_0xfa6306){return _0xfa6306 instanceof _0x1f20b5?_0xfa6306:new _0x1f20b5(function(_0x2bfe22){_0x2bfe22(_0xfa6306);});}return new(_0x1f20b5||(_0x1f20b5=Promise))(function(_0x2de118,_0x43d071){function _0x1d2641(_0x1ceb0f){try{_0x28b64f(_0x9e9609['next'](_0x1ceb0f));}catch(_0x32873f){_0x43d071(_0x32873f);}}function _0x55b861(_0x30545c){try{_0x28b64f(_0x9e9609['throw'](_0x30545c));}catch(_0x212850){_0x43d071(_0x212850);}}function _0x28b64f(_0x325548){_0x325548['done']?_0x2de118(_0x325548['value']):_0x1c5008(_0x325548['value'])['then'](_0x1d2641,_0x55b861);}_0x28b64f((_0x9e9609=_0x9e9609['apply'](_0x49d1f7,_0x191808||[]))['next']());});};class ListService{constructor(_0x18fa53){this['fetch']=_0x18fa53;}['add'](_0x513289,_0x2f14fc,_0x56154d){return __awaiter$2(this,void 0,void 0,function*(){const _0x367ee9='List',_0x260320={'account_name':_0x513289,'list_name':_0x2f14fc};try{const _0x1a7f73=yield this['fetch']['post'](_0x367ee9,_0x56154d,_0x260320);if(_0x1a7f73['status']>0xc7&&_0x1a7f73['status']<0x12c){const _0xe7c064=yield _0x1a7f73['json']();return new SuccessfulAccountResponse(_0xe7c064);}const _0x3e2111=yield _0x1a7f73['json']();return new FailedAccountResponse(_0x3e2111);}catch(_0x17d9ab){if(_0x17d9ab instanceof Error)return new FailedAccountResponse({'detail':_0x17d9ab['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x17d9ab;}});}['remove'](_0xa7a639,_0x2f72d6,_0x29c468){return __awaiter$2(this,void 0,void 0,function*(){const _0x5d8f7d='List/'+_0xa7a639+'/'+_0x2f72d6,_0x5cdd2d=yield this['fetch']['delete'](_0x5d8f7d,_0x29c468);try{if(_0x5cdd2d['status']>0xc7&&_0x5cdd2d['status']<0x12c){const _0x573db1=yield _0x5cdd2d['json']();return new SuccessfulAccountResponse(_0x573db1);}const _0x2e9670=yield _0x5cdd2d['json']();return new FailedAccountResponse(_0x2e9670);}catch(_0x48c325){if(_0x48c325 instanceof Error)return new FailedAccountResponse({'detail':_0x48c325['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x48c325;}});}}
11
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x31ebaf,_0x44b042,_0x415bc0,_0xd2357b){function _0x334195(_0x532365){return _0x532365 instanceof _0x415bc0?_0x532365:new _0x415bc0(function(_0x13b59c){_0x13b59c(_0x532365);});}return new(_0x415bc0||(_0x415bc0=Promise))(function(_0x2264f1,_0x38e7f2){function _0x205e16(_0x1c4c5e){try{_0x17af5c(_0xd2357b['next'](_0x1c4c5e));}catch(_0x5aeedc){_0x38e7f2(_0x5aeedc);}}function _0x29bf7d(_0x4dcc23){try{_0x17af5c(_0xd2357b['throw'](_0x4dcc23));}catch(_0x4fa470){_0x38e7f2(_0x4fa470);}}function _0x17af5c(_0x178bde){_0x178bde['done']?_0x2264f1(_0x178bde['value']):_0x334195(_0x178bde['value'])['then'](_0x205e16,_0x29bf7d);}_0x17af5c((_0xd2357b=_0xd2357b['apply'](_0x31ebaf,_0x44b042||[]))['next']());});};class ListService{constructor(_0x485925){this['fetch']=_0x485925;}['add'](_0x5cee0e,_0x284a38,_0x5d5afc){return __awaiter$2(this,void 0,void 0,function*(){const _0x7b7a6d='List',_0x5a9087={'account_name':_0x5cee0e,'list_name':_0x284a38};try{const _0x4474b9=yield this['fetch']['post'](_0x7b7a6d,_0x5d5afc,_0x5a9087);if(_0x4474b9['status']>0xc7&&_0x4474b9['status']<0x12c){const _0x514fbb=yield _0x4474b9['json']();return new SuccessfulAccountResponse(_0x514fbb);}const _0x201c24=yield _0x4474b9['json']();return new FailedAccountResponse(_0x201c24);}catch(_0x59b3e4){if(_0x59b3e4 instanceof Error)return new FailedAccountResponse({'detail':_0x59b3e4['message'],'title':_0x59b3e4['name'],'status':0x1f4,'instance':'','type':''});throw _0x59b3e4;}});}['remove'](_0x309f13,_0x52a833,_0x1f32bc){return __awaiter$2(this,void 0,void 0,function*(){const _0x5d1091='List/'+_0x309f13+'/'+_0x52a833,_0x25b1dd=yield this['fetch']['delete'](_0x5d1091,_0x1f32bc);try{if(_0x25b1dd['status']>0xc7&&_0x25b1dd['status']<0x12c){const _0x50dbae=yield _0x25b1dd['json']();return new SuccessfulAccountResponse(_0x50dbae);}const _0x2429d4=yield _0x25b1dd['json']();return new FailedAccountResponse(_0x2429d4);}catch(_0x7be3b9){if(_0x7be3b9 instanceof Error)return new FailedAccountResponse({'detail':_0x7be3b9['message'],'title':_0x7be3b9['name'],'status':0x1f4,'instance':'','type':''});throw _0x7be3b9;}});}}
12
12
 
13
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2b392b,_0x38a1a1,_0x3baf86,_0x161e55){function _0x1320fc(_0x559161){return _0x559161 instanceof _0x3baf86?_0x559161:new _0x3baf86(function(_0x5ec816){_0x5ec816(_0x559161);});}return new(_0x3baf86||(_0x3baf86=Promise))(function(_0x28e140,_0x1ecdcf){function _0x35f2bc(_0x509e94){try{_0x50967c(_0x161e55['next'](_0x509e94));}catch(_0x211092){_0x1ecdcf(_0x211092);}}function _0x2f67e6(_0x5093e7){try{_0x50967c(_0x161e55['throw'](_0x5093e7));}catch(_0x2958df){_0x1ecdcf(_0x2958df);}}function _0x50967c(_0xf79882){_0xf79882['done']?_0x28e140(_0xf79882['value']):_0x1320fc(_0xf79882['value'])['then'](_0x35f2bc,_0x2f67e6);}_0x50967c((_0x161e55=_0x161e55['apply'](_0x2b392b,_0x38a1a1||[]))['next']());});};class Fetch{constructor(_0x120b26){this['baseUri']=_0x120b26,this['getUrl']=_0x393e4a=>{return _0x393e4a['startsWith']('/')&&(_0x393e4a=_0x393e4a['replace']('/','')),''+this['baseUri']+_0x393e4a;},!_0x120b26['endsWith']('/')&&(_0x120b26=_0x120b26+'/');}['get'](_0x36695f,_0x2b91d3){return __awaiter$1(this,void 0,void 0,function*(){const _0x2c006f=this['getUrl'](_0x36695f);return yield fetch(_0x2c006f,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2b91d3}});});}['post'](_0x5939f9,_0x3f9fb1,_0x4e4f55){return __awaiter$1(this,void 0,void 0,function*(){const _0x574f2e=this['getUrl'](_0x5939f9);return yield fetch(_0x574f2e,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3f9fb1},'body':_0x4e4f55?JSON['stringify'](_0x4e4f55):null});});}['put'](_0x490e11,_0x490c6a,_0x533728){return __awaiter$1(this,void 0,void 0,function*(){const _0x426e09=this['getUrl'](_0x490e11);return yield fetch(_0x426e09,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x490c6a},'body':_0x533728?JSON['stringify'](_0x533728):null});});}['delete'](_0x57cfea,_0x38fff4){return __awaiter$1(this,void 0,void 0,function*(){const _0x3a252e=this['getUrl'](_0x57cfea);return yield fetch(_0x3a252e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x38fff4}});});}}
13
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1cca1b,_0x34980c,_0x2ae9ca,_0x36b334){function _0x399f1e(_0x496dcc){return _0x496dcc instanceof _0x2ae9ca?_0x496dcc:new _0x2ae9ca(function(_0x16ed42){_0x16ed42(_0x496dcc);});}return new(_0x2ae9ca||(_0x2ae9ca=Promise))(function(_0x1fb173,_0x54fdea){function _0x401f12(_0x3977ab){try{_0x319567(_0x36b334['next'](_0x3977ab));}catch(_0x563f98){_0x54fdea(_0x563f98);}}function _0x1558e4(_0x587225){try{_0x319567(_0x36b334['throw'](_0x587225));}catch(_0x91baeb){_0x54fdea(_0x91baeb);}}function _0x319567(_0x53da41){_0x53da41['done']?_0x1fb173(_0x53da41['value']):_0x399f1e(_0x53da41['value'])['then'](_0x401f12,_0x1558e4);}_0x319567((_0x36b334=_0x36b334['apply'](_0x1cca1b,_0x34980c||[]))['next']());});};class Fetch{constructor(_0xc1d696){this['baseUri']=_0xc1d696,this['getUrl']=_0x29cb32=>{return _0x29cb32['startsWith']('/')&&(_0x29cb32=_0x29cb32['replace']('/','')),''+this['baseUri']+_0x29cb32;},!_0xc1d696['endsWith']('/')&&(_0xc1d696=_0xc1d696+'/');}['get'](_0xcac316,_0x3bc8fd){return __awaiter$1(this,void 0,void 0,function*(){const _0x4d3f9f=this['getUrl'](_0xcac316);return yield fetch(_0x4d3f9f,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3bc8fd}});});}['post'](_0x1c2b8f,_0x2f1302,_0x563168){return __awaiter$1(this,void 0,void 0,function*(){const _0x3e8213=this['getUrl'](_0x1c2b8f);return yield fetch(_0x3e8213,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2f1302},'body':_0x563168?JSON['stringify'](_0x563168):null});});}['put'](_0x4d5cfa,_0x2e044a,_0x25df55){return __awaiter$1(this,void 0,void 0,function*(){const _0x5369af=this['getUrl'](_0x4d5cfa);return yield fetch(_0x5369af,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2e044a},'body':_0x25df55?JSON['stringify'](_0x25df55):null});});}['delete'](_0x54754f,_0x21b821){return __awaiter$1(this,void 0,void 0,function*(){const _0x3e4025=this['getUrl'](_0x54754f);return yield fetch(_0x3e4025,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x21b821}});});}}
14
14
 
15
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x70a7e3,_0x23c876,_0x3c3dfd,_0x49df2a){function _0x263dc7(_0x5435b6){return _0x5435b6 instanceof _0x3c3dfd?_0x5435b6:new _0x3c3dfd(function(_0x4c72a0){_0x4c72a0(_0x5435b6);});}return new(_0x3c3dfd||(_0x3c3dfd=Promise))(function(_0x1368d7,_0x380541){function _0x193502(_0x3d8e95){try{_0xe96160(_0x49df2a['next'](_0x3d8e95));}catch(_0x443858){_0x380541(_0x443858);}}function _0x52c156(_0x1e4338){try{_0xe96160(_0x49df2a['throw'](_0x1e4338));}catch(_0x46fc1f){_0x380541(_0x46fc1f);}}function _0xe96160(_0x59645f){_0x59645f['done']?_0x1368d7(_0x59645f['value']):_0x263dc7(_0x59645f['value'])['then'](_0x193502,_0x52c156);}_0xe96160((_0x49df2a=_0x49df2a['apply'](_0x70a7e3,_0x23c876||[]))['next']());});};class AdminClient{constructor(_0x7289d6='https://admin.searchability.dev/'){var _0x4134e4=new Fetch(_0x7289d6);this['Accounts']=new AccountService(_0x4134e4),this['Lists']=new ListService(_0x4134e4),this['ApiKeys']=new ApiKeyService(_0x4134e4);}}class AuthClient{constructor(_0x37920e='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x37920e);}['login'](_0x4d7be0){return __awaiter(this,void 0,void 0,function*(){var _0x1445cc='login/'+_0x4d7be0;try{const _0x2ceb7e=yield yield fetch(_0x1445cc);if(_0x2ceb7e['status']>0xc7&&_0x2ceb7e['status']<0x12c){const _0x3a33bd=yield _0x2ceb7e['json']();return new SuccessfulAuthResponse(_0x3a33bd);}const _0x36673b=yield _0x2ceb7e['json']();return new FailedAuthResponse(_0x36673b);}catch(_0x55e8da){if(_0x55e8da instanceof Error)return new FailedAuthResponse({'detail':_0x55e8da['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x55e8da;}});}['refresh'](_0x5a2f46){return __awaiter(this,void 0,void 0,function*(){var _0x89c097='refresh';try{const _0x99212b=yield this['fetch']['post'](_0x89c097,_0x5a2f46,null);if(_0x99212b['status']>0xc7&&_0x99212b['status']<0x12c){const _0x1cee4b=yield _0x99212b['json']();return new SuccessfulAuthResponse(_0x1cee4b);}const _0x501c4f=yield _0x99212b['json']();return new FailedAuthResponse(_0x501c4f);}catch(_0x149da7){if(_0x149da7 instanceof Error)return new FailedAuthResponse({'detail':_0x149da7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x149da7;}});}}
15
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x5d2295,_0x28efaa,_0x52b2a8,_0x6134ab){function _0xeaa7dc(_0x4ec335){return _0x4ec335 instanceof _0x52b2a8?_0x4ec335:new _0x52b2a8(function(_0x3361d5){_0x3361d5(_0x4ec335);});}return new(_0x52b2a8||(_0x52b2a8=Promise))(function(_0x3fb3b9,_0x1a2ead){function _0x58dd38(_0x1cbd34){try{_0x415536(_0x6134ab['next'](_0x1cbd34));}catch(_0x20b55b){_0x1a2ead(_0x20b55b);}}function _0x1123f0(_0x3fcafb){try{_0x415536(_0x6134ab['throw'](_0x3fcafb));}catch(_0x2b43e4){_0x1a2ead(_0x2b43e4);}}function _0x415536(_0x514e65){_0x514e65['done']?_0x3fb3b9(_0x514e65['value']):_0xeaa7dc(_0x514e65['value'])['then'](_0x58dd38,_0x1123f0);}_0x415536((_0x6134ab=_0x6134ab['apply'](_0x5d2295,_0x28efaa||[]))['next']());});};class AdminClient{constructor(_0x50131f='https://admin.searchability.dev/'){var _0x23e1c9=new Fetch(_0x50131f);this['Accounts']=new AccountService(_0x23e1c9),this['Lists']=new ListService(_0x23e1c9),this['ApiKeys']=new ApiKeyService(_0x23e1c9);}}class AuthClient{constructor(_0x30b180='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x30b180);}['login'](_0x4c52c3){return __awaiter(this,void 0,void 0,function*(){var _0x15798c='login/'+_0x4c52c3;try{const _0x3297d7=yield yield fetch(_0x15798c);if(_0x3297d7['status']>0xc7&&_0x3297d7['status']<0x12c){const _0x236a5a=yield _0x3297d7['json']();return new SuccessfulAuthResponse(_0x236a5a);}const _0x16ee95=yield _0x3297d7['json']();return new FailedAuthResponse(_0x16ee95);}catch(_0x14b76e){if(_0x14b76e instanceof Error)return new FailedAuthResponse({'detail':_0x14b76e['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x14b76e;}});}['refresh'](_0x2abb82){return __awaiter(this,void 0,void 0,function*(){var _0x40befe='refresh';try{const _0x5bcf09=yield this['fetch']['post'](_0x40befe,_0x2abb82,null);if(_0x5bcf09['status']>0xc7&&_0x5bcf09['status']<0x12c){const _0x578c9e=yield _0x5bcf09['json']();return new SuccessfulAuthResponse(_0x578c9e);}const _0x40cc9f=yield _0x5bcf09['json']();return new FailedAuthResponse(_0x40cc9f);}catch(_0x137272){if(_0x137272 instanceof Error)return new FailedAuthResponse({'detail':_0x137272['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x137272;}});}}
16
16
 
17
17
  exports.AdminClient = AdminClient;
18
18
  exports.AuthClient = AuthClient;
@@ -1,15 +1,15 @@
1
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x22c4a3,_0x171996,_0x331044,_0x57c976){function _0x5b1a02(_0x3d5357){return _0x3d5357 instanceof _0x331044?_0x3d5357:new _0x331044(function(_0x26f6f7){_0x26f6f7(_0x3d5357);});}return new(_0x331044||(_0x331044=Promise))(function(_0x1ab65b,_0x4ed074){function _0x8907a7(_0x7d72c5){try{_0x23831f(_0x57c976['next'](_0x7d72c5));}catch(_0x148e26){_0x4ed074(_0x148e26);}}function _0x55d15f(_0x21bd3d){try{_0x23831f(_0x57c976['throw'](_0x21bd3d));}catch(_0x6b52d4){_0x4ed074(_0x6b52d4);}}function _0x23831f(_0xe082d3){_0xe082d3['done']?_0x1ab65b(_0xe082d3['value']):_0x5b1a02(_0xe082d3['value'])['then'](_0x8907a7,_0x55d15f);}_0x23831f((_0x57c976=_0x57c976['apply'](_0x22c4a3,_0x171996||[]))['next']());});};class TokenManager{constructor(_0xb6d020){this['authClient']=_0xb6d020;}['getOrRefreshTokens'](_0x40a396){return __awaiter$5(this,void 0,void 0,function*(){if(Date['now']()<_0x40a396['access_expires'])return new SuccessfulAuthResponse(_0x40a396);if(Date['now']()<_0x40a396['refresh_expires'])return yield this['authClient']['refresh'](_0x40a396['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
1
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0xe2b934,_0x3e462f,_0x3d14f3,_0x58fe99){function _0x611d7c(_0x7acbe0){return _0x7acbe0 instanceof _0x3d14f3?_0x7acbe0:new _0x3d14f3(function(_0x908f62){_0x908f62(_0x7acbe0);});}return new(_0x3d14f3||(_0x3d14f3=Promise))(function(_0x2c4317,_0x54a8f6){function _0x1bb5bb(_0x2135b6){try{_0x3cb4be(_0x58fe99['next'](_0x2135b6));}catch(_0xad9783){_0x54a8f6(_0xad9783);}}function _0x3e477c(_0x215018){try{_0x3cb4be(_0x58fe99['throw'](_0x215018));}catch(_0xaa2412){_0x54a8f6(_0xaa2412);}}function _0x3cb4be(_0x5b34be){_0x5b34be['done']?_0x2c4317(_0x5b34be['value']):_0x611d7c(_0x5b34be['value'])['then'](_0x1bb5bb,_0x3e477c);}_0x3cb4be((_0x58fe99=_0x58fe99['apply'](_0xe2b934,_0x3e462f||[]))['next']());});};class TokenManager{constructor(_0x41ce89){this['authClient']=_0x41ce89;}['getOrRefreshTokens'](_0x3c1f4d){return __awaiter$5(this,void 0,void 0,function*(){if(Date['now']()<_0x3c1f4d['access_expires'])return new SuccessfulAuthResponse(_0x3c1f4d);if(Date['now']()<_0x3c1f4d['refresh_expires'])return yield this['authClient']['refresh'](_0x3c1f4d['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
2
2
 
3
- class Response{constructor(_0x3ecdbd){this['isSuccess']=_0x3ecdbd;}}class SuccessfulAccountResponse extends Response{constructor(_0x1eeae8){super(!![]),this['account']=_0x1eeae8;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x38c206){super(![]),this['problem']=_0x38c206;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x147c41){super(!![]),this['tokens']=_0x147c41;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x4c823c){super(![]),this['problem']=_0x4c823c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x156eed){super(!![]),this['apiKey']=_0x156eed;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x138ff0){super(![]),this['problem']=_0x138ff0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
3
+ class Response{constructor(_0x1e9aa6){this['isSuccess']=_0x1e9aa6;}}class SuccessfulAccountResponse extends Response{constructor(_0x12cbeb){super(!![]),this['account']=_0x12cbeb;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3f4b8a){super(![]),this['problem']=_0x3f4b8a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x5da66d){super(!![]),this['tokens']=_0x5da66d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x59bfe6){super(![]),this['problem']=_0x59bfe6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x14ce79){super(!![]),this['apiKey']=_0x14ce79;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x3a5fd0){super(![]),this['problem']=_0x3a5fd0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x1e336a){super(!![]),this['apiKeyValue']=_0x1e336a;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyValueResponse extends Response{constructor(_0x4a5198){super(![]),this['problem']=_0x4a5198;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
4
 
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4d7613,_0x5d59e6,_0x5d78ad,_0x5d4b8d){function _0x4fdc2b(_0x2b4f51){return _0x2b4f51 instanceof _0x5d78ad?_0x2b4f51:new _0x5d78ad(function(_0x26edf3){_0x26edf3(_0x2b4f51);});}return new(_0x5d78ad||(_0x5d78ad=Promise))(function(_0x19401c,_0x10a790){function _0x5b6d2a(_0x4b194a){try{_0xf7fa22(_0x5d4b8d['next'](_0x4b194a));}catch(_0x595f3b){_0x10a790(_0x595f3b);}}function _0x21e232(_0x131d0f){try{_0xf7fa22(_0x5d4b8d['throw'](_0x131d0f));}catch(_0x501dd2){_0x10a790(_0x501dd2);}}function _0xf7fa22(_0x591869){_0x591869['done']?_0x19401c(_0x591869['value']):_0x4fdc2b(_0x591869['value'])['then'](_0x5b6d2a,_0x21e232);}_0xf7fa22((_0x5d4b8d=_0x5d4b8d['apply'](_0x4d7613,_0x5d59e6||[]))['next']());});};class AccountService{constructor(_0x4e0ded){this['fetch']=_0x4e0ded;}['get'](_0x208018,_0x558210){return __awaiter$4(this,void 0,void 0,function*(){const _0x4f856a='Account/'+_0x208018+'/',_0xea274d=yield this['fetch']['get'](_0x4f856a,_0x558210);try{if(_0xea274d['status']>0xc7&&_0xea274d['status']<0x12c){const _0x42d32e=yield _0xea274d['json']();return new SuccessfulAccountResponse(_0x42d32e);}const _0x285db8=yield _0xea274d['json']();return new FailedAccountResponse(_0x285db8);}catch(_0x225750){if(_0x225750 instanceof Error)return new FailedAccountResponse({'detail':_0x225750['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x225750;}});}}
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2312ab,_0x59223e,_0x5759b8,_0x2954fd){function _0x3b7ac7(_0x429514){return _0x429514 instanceof _0x5759b8?_0x429514:new _0x5759b8(function(_0x54a629){_0x54a629(_0x429514);});}return new(_0x5759b8||(_0x5759b8=Promise))(function(_0x303b5a,_0x19cf97){function _0x28023a(_0xb524c5){try{_0x5f3c36(_0x2954fd['next'](_0xb524c5));}catch(_0x32427d){_0x19cf97(_0x32427d);}}function _0x74cb1b(_0x3d8643){try{_0x5f3c36(_0x2954fd['throw'](_0x3d8643));}catch(_0x3b3377){_0x19cf97(_0x3b3377);}}function _0x5f3c36(_0x3f303c){_0x3f303c['done']?_0x303b5a(_0x3f303c['value']):_0x3b7ac7(_0x3f303c['value'])['then'](_0x28023a,_0x74cb1b);}_0x5f3c36((_0x2954fd=_0x2954fd['apply'](_0x2312ab,_0x59223e||[]))['next']());});};class AccountService{constructor(_0x59f121){this['fetch']=_0x59f121;}['get'](_0xde0377,_0x53e24a){return __awaiter$4(this,void 0,void 0,function*(){const _0x2d9645='Account/'+_0xde0377+'/',_0x546d5c=yield this['fetch']['get'](_0x2d9645,_0x53e24a);try{if(_0x546d5c['status']>0xc7&&_0x546d5c['status']<0x12c){const _0x214798=yield _0x546d5c['json']();return new SuccessfulAccountResponse(_0x214798);}const _0x2119f0=yield _0x546d5c['json']();return new FailedAccountResponse(_0x2119f0);}catch(_0x42ce28){if(_0x42ce28 instanceof Error)return new FailedAccountResponse({'detail':_0x42ce28['message'],'title':_0x42ce28['name'],'status':0x1f4,'instance':'','type':''});throw _0x42ce28;}});}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x53cd3d,_0x3db661,_0x52e895,_0x5c91a3){function _0x3b4e95(_0x45f15e){return _0x45f15e instanceof _0x52e895?_0x45f15e:new _0x52e895(function(_0x351832){_0x351832(_0x45f15e);});}return new(_0x52e895||(_0x52e895=Promise))(function(_0x3311e5,_0x593842){function _0x3a2e66(_0x2afa18){try{_0x471d51(_0x5c91a3['next'](_0x2afa18));}catch(_0x336ae5){_0x593842(_0x336ae5);}}function _0x34c633(_0x5880fc){try{_0x471d51(_0x5c91a3['throw'](_0x5880fc));}catch(_0x55f923){_0x593842(_0x55f923);}}function _0x471d51(_0xac7d3a){_0xac7d3a['done']?_0x3311e5(_0xac7d3a['value']):_0x3b4e95(_0xac7d3a['value'])['then'](_0x3a2e66,_0x34c633);}_0x471d51((_0x5c91a3=_0x5c91a3['apply'](_0x53cd3d,_0x3db661||[]))['next']());});};class ApiKeyService{constructor(_0x5a6280){this['fetch']=_0x5a6280;}['create'](_0x1b239e,_0x4a05b2,_0x50d2ab){return __awaiter$3(this,void 0,void 0,function*(){const _0x1257a4='api-key/create',_0x97e576={'account_name':_0x1b239e,'api_key_name':_0x4a05b2};try{const _0x482f6c=yield this['fetch']['post'](_0x1257a4,_0x50d2ab,_0x97e576);if(_0x482f6c['status']>0xc7&&_0x482f6c['status']<0x12c){const _0x109175=yield _0x482f6c['json']();return new SuccessfulApiKeyResponse(_0x109175);}const _0xf4f786=yield _0x482f6c['json']();return new FailedApiKeyResponse(_0xf4f786);}catch(_0x254b19){if(_0x254b19 instanceof Error)return new FailedApiKeyResponse({'detail':_0x254b19['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x254b19;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x383537,_0xd1f539,_0x333883,_0x3525b0){function _0x1b65db(_0x20df49){return _0x20df49 instanceof _0x333883?_0x20df49:new _0x333883(function(_0x2c45f1){_0x2c45f1(_0x20df49);});}return new(_0x333883||(_0x333883=Promise))(function(_0x485088,_0x2594a1){function _0x2ac383(_0x137b30){try{_0x5c676f(_0x3525b0['next'](_0x137b30));}catch(_0x602b2f){_0x2594a1(_0x602b2f);}}function _0x4e2b7a(_0x23e351){try{_0x5c676f(_0x3525b0['throw'](_0x23e351));}catch(_0x30bab9){_0x2594a1(_0x30bab9);}}function _0x5c676f(_0x19b387){_0x19b387['done']?_0x485088(_0x19b387['value']):_0x1b65db(_0x19b387['value'])['then'](_0x2ac383,_0x4e2b7a);}_0x5c676f((_0x3525b0=_0x3525b0['apply'](_0x383537,_0xd1f539||[]))['next']());});};class ApiKeyService{constructor(_0x3edb41){this['fetch']=_0x3edb41;}['create'](_0x36d42d,_0x17dccf,_0x10d2b5){return __awaiter$3(this,void 0,void 0,function*(){const _0x523f46='api-key/create',_0x287929={'account_name':_0x36d42d,'api_key_name':_0x17dccf};try{const _0x15e353=yield this['fetch']['post'](_0x523f46,_0x10d2b5,_0x287929);if(_0x15e353['status']>0xc7&&_0x15e353['status']<0x12c){const _0xb9100b=yield _0x15e353['json']();return new SuccessfulApiKeyResponse(_0xb9100b);}const _0x17b26d=yield _0x15e353['json']();return new FailedApiKeyResponse(_0x17b26d);}catch(_0x32d098){if(_0x32d098 instanceof Error)return new FailedApiKeyResponse({'detail':_0x32d098['message'],'title':_0x32d098['name'],'status':0x1f4,'instance':'','type':''});throw _0x32d098;}});}['view'](_0x3a8377,_0x3f8e53,_0x46840b){return __awaiter$3(this,void 0,void 0,function*(){const _0x1f88f4='api-key/'+_0x3a8377+'/'+_0x3f8e53;try{const _0x1cc53c=yield this['fetch']['get'](_0x1f88f4,_0x46840b);if(_0x1cc53c['status']>0xc7&&_0x1cc53c['status']<0x12c){const _0x449bf0=yield _0x1cc53c['json']();return new SuccessfulApiKeyValueResponse(_0x449bf0);}const _0x297008=yield _0x1cc53c['json']();return new FailedApiKeyValueResponse(_0x297008);}catch(_0x300c9a){if(_0x300c9a instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x300c9a['message'],'title':_0x300c9a['name'],'status':0x1f4,'instance':'','type':''});throw _0x300c9a;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x9e87a7,_0x2a48f4,_0x143602,_0x4f56fe){function _0x1244b8(_0xc1de7){return _0xc1de7 instanceof _0x143602?_0xc1de7:new _0x143602(function(_0x1ded71){_0x1ded71(_0xc1de7);});}return new(_0x143602||(_0x143602=Promise))(function(_0x5b3af0,_0x517366){function _0x3cf954(_0x48a149){try{_0x5c6bfd(_0x4f56fe['next'](_0x48a149));}catch(_0xab6880){_0x517366(_0xab6880);}}function _0x237864(_0x44ca8f){try{_0x5c6bfd(_0x4f56fe['throw'](_0x44ca8f));}catch(_0x13f047){_0x517366(_0x13f047);}}function _0x5c6bfd(_0x47a31c){_0x47a31c['done']?_0x5b3af0(_0x47a31c['value']):_0x1244b8(_0x47a31c['value'])['then'](_0x3cf954,_0x237864);}_0x5c6bfd((_0x4f56fe=_0x4f56fe['apply'](_0x9e87a7,_0x2a48f4||[]))['next']());});};class ListService{constructor(_0x43baba){this['fetch']=_0x43baba;}['add'](_0x53f2f5,_0x3a2180,_0x51a19c){return __awaiter$2(this,void 0,void 0,function*(){const _0x54355a='List',_0x41bab3={'account_name':_0x53f2f5,'list_name':_0x3a2180};try{const _0x19c539=yield this['fetch']['post'](_0x54355a,_0x51a19c,_0x41bab3);if(_0x19c539['status']>0xc7&&_0x19c539['status']<0x12c){const _0x1ff9cc=yield _0x19c539['json']();return new SuccessfulAccountResponse(_0x1ff9cc);}const _0x1bacdd=yield _0x19c539['json']();return new FailedAccountResponse(_0x1bacdd);}catch(_0x146d49){if(_0x146d49 instanceof Error)return new FailedAccountResponse({'detail':_0x146d49['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x146d49;}});}['remove'](_0x530088,_0x14f329,_0x2468dd){return __awaiter$2(this,void 0,void 0,function*(){const _0x3cf0b4='List/'+_0x530088+'/'+_0x14f329,_0x1dd50f=yield this['fetch']['delete'](_0x3cf0b4,_0x2468dd);try{if(_0x1dd50f['status']>0xc7&&_0x1dd50f['status']<0x12c){const _0x2cdf9f=yield _0x1dd50f['json']();return new SuccessfulAccountResponse(_0x2cdf9f);}const _0x1e6749=yield _0x1dd50f['json']();return new FailedAccountResponse(_0x1e6749);}catch(_0x44a1bf){if(_0x44a1bf instanceof Error)return new FailedAccountResponse({'detail':_0x44a1bf['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x44a1bf;}});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x508d9c,_0xfdc06,_0x5aa124,_0x3cd699){function _0x21e755(_0x7ebaf2){return _0x7ebaf2 instanceof _0x5aa124?_0x7ebaf2:new _0x5aa124(function(_0x3e567b){_0x3e567b(_0x7ebaf2);});}return new(_0x5aa124||(_0x5aa124=Promise))(function(_0x25cd85,_0x143158){function _0x4b8005(_0x548205){try{_0x2f7ee3(_0x3cd699['next'](_0x548205));}catch(_0x44bb6e){_0x143158(_0x44bb6e);}}function _0x382323(_0x2e8614){try{_0x2f7ee3(_0x3cd699['throw'](_0x2e8614));}catch(_0x3e1071){_0x143158(_0x3e1071);}}function _0x2f7ee3(_0x376df9){_0x376df9['done']?_0x25cd85(_0x376df9['value']):_0x21e755(_0x376df9['value'])['then'](_0x4b8005,_0x382323);}_0x2f7ee3((_0x3cd699=_0x3cd699['apply'](_0x508d9c,_0xfdc06||[]))['next']());});};class ListService{constructor(_0x3f4da3){this['fetch']=_0x3f4da3;}['add'](_0x4017a1,_0x3511cb,_0x1753a0){return __awaiter$2(this,void 0,void 0,function*(){const _0x2e47be='List',_0x561919={'account_name':_0x4017a1,'list_name':_0x3511cb};try{const _0x568b1c=yield this['fetch']['post'](_0x2e47be,_0x1753a0,_0x561919);if(_0x568b1c['status']>0xc7&&_0x568b1c['status']<0x12c){const _0x1d8846=yield _0x568b1c['json']();return new SuccessfulAccountResponse(_0x1d8846);}const _0x22bf4d=yield _0x568b1c['json']();return new FailedAccountResponse(_0x22bf4d);}catch(_0x4c6959){if(_0x4c6959 instanceof Error)return new FailedAccountResponse({'detail':_0x4c6959['message'],'title':_0x4c6959['name'],'status':0x1f4,'instance':'','type':''});throw _0x4c6959;}});}['remove'](_0x4fcc48,_0x2fed64,_0x5c0bb3){return __awaiter$2(this,void 0,void 0,function*(){const _0x1bcb51='List/'+_0x4fcc48+'/'+_0x2fed64,_0x14adf0=yield this['fetch']['delete'](_0x1bcb51,_0x5c0bb3);try{if(_0x14adf0['status']>0xc7&&_0x14adf0['status']<0x12c){const _0x383d7b=yield _0x14adf0['json']();return new SuccessfulAccountResponse(_0x383d7b);}const _0x155bcf=yield _0x14adf0['json']();return new FailedAccountResponse(_0x155bcf);}catch(_0x5c977d){if(_0x5c977d instanceof Error)return new FailedAccountResponse({'detail':_0x5c977d['message'],'title':_0x5c977d['name'],'status':0x1f4,'instance':'','type':''});throw _0x5c977d;}});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1921c9,_0x2b416a,_0x4be3e4,_0x4f11cd){function _0x497a0d(_0x54017c){return _0x54017c instanceof _0x4be3e4?_0x54017c:new _0x4be3e4(function(_0x51e930){_0x51e930(_0x54017c);});}return new(_0x4be3e4||(_0x4be3e4=Promise))(function(_0x1fff5b,_0x5d1c8a){function _0x520750(_0x2258f8){try{_0x453509(_0x4f11cd['next'](_0x2258f8));}catch(_0x90bb21){_0x5d1c8a(_0x90bb21);}}function _0x26a891(_0x2212fd){try{_0x453509(_0x4f11cd['throw'](_0x2212fd));}catch(_0xeaeb91){_0x5d1c8a(_0xeaeb91);}}function _0x453509(_0x54eaa6){_0x54eaa6['done']?_0x1fff5b(_0x54eaa6['value']):_0x497a0d(_0x54eaa6['value'])['then'](_0x520750,_0x26a891);}_0x453509((_0x4f11cd=_0x4f11cd['apply'](_0x1921c9,_0x2b416a||[]))['next']());});};class Fetch{constructor(_0x4c54e3){this['baseUri']=_0x4c54e3,this['getUrl']=_0x181bdc=>{return _0x181bdc['startsWith']('/')&&(_0x181bdc=_0x181bdc['replace']('/','')),''+this['baseUri']+_0x181bdc;},!_0x4c54e3['endsWith']('/')&&(_0x4c54e3=_0x4c54e3+'/');}['get'](_0x1fac36,_0x5ca69b){return __awaiter$1(this,void 0,void 0,function*(){const _0x2bc32d=this['getUrl'](_0x1fac36);return yield fetch(_0x2bc32d,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5ca69b}});});}['post'](_0x320b35,_0x2d223c,_0x37bb9a){return __awaiter$1(this,void 0,void 0,function*(){const _0x2d26b0=this['getUrl'](_0x320b35);return yield fetch(_0x2d26b0,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2d223c},'body':_0x37bb9a?JSON['stringify'](_0x37bb9a):null});});}['put'](_0x56054e,_0xd53b08,_0x37f6f0){return __awaiter$1(this,void 0,void 0,function*(){const _0x137ee5=this['getUrl'](_0x56054e);return yield fetch(_0x137ee5,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xd53b08},'body':_0x37f6f0?JSON['stringify'](_0x37f6f0):null});});}['delete'](_0x5d5ea5,_0x2f0cf2){return __awaiter$1(this,void 0,void 0,function*(){const _0xa4fdf3=this['getUrl'](_0x5d5ea5);return yield fetch(_0xa4fdf3,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2f0cf2}});});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xfaee5d,_0x204912,_0x2b5b8c,_0x5c45e0){function _0x12c15b(_0x326a79){return _0x326a79 instanceof _0x2b5b8c?_0x326a79:new _0x2b5b8c(function(_0x5dd61b){_0x5dd61b(_0x326a79);});}return new(_0x2b5b8c||(_0x2b5b8c=Promise))(function(_0x2aee4c,_0x4f71bc){function _0x56a35c(_0x23e0c2){try{_0xad314a(_0x5c45e0['next'](_0x23e0c2));}catch(_0x27a018){_0x4f71bc(_0x27a018);}}function _0x529c2f(_0x1c0c30){try{_0xad314a(_0x5c45e0['throw'](_0x1c0c30));}catch(_0x47c4c7){_0x4f71bc(_0x47c4c7);}}function _0xad314a(_0x538cc6){_0x538cc6['done']?_0x2aee4c(_0x538cc6['value']):_0x12c15b(_0x538cc6['value'])['then'](_0x56a35c,_0x529c2f);}_0xad314a((_0x5c45e0=_0x5c45e0['apply'](_0xfaee5d,_0x204912||[]))['next']());});};class Fetch{constructor(_0x52dff9){this['baseUri']=_0x52dff9,this['getUrl']=_0x551c3c=>{return _0x551c3c['startsWith']('/')&&(_0x551c3c=_0x551c3c['replace']('/','')),''+this['baseUri']+_0x551c3c;},!_0x52dff9['endsWith']('/')&&(_0x52dff9=_0x52dff9+'/');}['get'](_0x20f1d5,_0x238395){return __awaiter$1(this,void 0,void 0,function*(){const _0x3a4c04=this['getUrl'](_0x20f1d5);return yield fetch(_0x3a4c04,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x238395}});});}['post'](_0x8a938b,_0x28062f,_0x17b16b){return __awaiter$1(this,void 0,void 0,function*(){const _0x3a5465=this['getUrl'](_0x8a938b);return yield fetch(_0x3a5465,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x28062f},'body':_0x17b16b?JSON['stringify'](_0x17b16b):null});});}['put'](_0x400b8f,_0x301d92,_0x51ff52){return __awaiter$1(this,void 0,void 0,function*(){const _0x50078a=this['getUrl'](_0x400b8f);return yield fetch(_0x50078a,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x301d92},'body':_0x51ff52?JSON['stringify'](_0x51ff52):null});});}['delete'](_0x1df9a0,_0xca475){return __awaiter$1(this,void 0,void 0,function*(){const _0x287b1d=this['getUrl'](_0x1df9a0);return yield fetch(_0x287b1d,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xca475}});});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x567704,_0x5d8587,_0x3a3eb4,_0x338534){function _0x387830(_0x274db4){return _0x274db4 instanceof _0x3a3eb4?_0x274db4:new _0x3a3eb4(function(_0x477af7){_0x477af7(_0x274db4);});}return new(_0x3a3eb4||(_0x3a3eb4=Promise))(function(_0x28ee44,_0x2e1716){function _0x4e5f(_0x5125a0){try{_0x3ed8a9(_0x338534['next'](_0x5125a0));}catch(_0x3e8776){_0x2e1716(_0x3e8776);}}function _0x30dcc8(_0x2f0435){try{_0x3ed8a9(_0x338534['throw'](_0x2f0435));}catch(_0x596ce8){_0x2e1716(_0x596ce8);}}function _0x3ed8a9(_0x259943){_0x259943['done']?_0x28ee44(_0x259943['value']):_0x387830(_0x259943['value'])['then'](_0x4e5f,_0x30dcc8);}_0x3ed8a9((_0x338534=_0x338534['apply'](_0x567704,_0x5d8587||[]))['next']());});};class AdminClient{constructor(_0x7df90a='https://admin.searchability.dev/'){var _0x57ab82=new Fetch(_0x7df90a);this['Accounts']=new AccountService(_0x57ab82),this['Lists']=new ListService(_0x57ab82),this['ApiKeys']=new ApiKeyService(_0x57ab82);}}class AuthClient{constructor(_0x1db6ef='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1db6ef);}['login'](_0xbd46f8){return __awaiter(this,void 0,void 0,function*(){var _0x2fbc3a='login/'+_0xbd46f8;try{const _0x3a9fae=yield yield fetch(_0x2fbc3a);if(_0x3a9fae['status']>0xc7&&_0x3a9fae['status']<0x12c){const _0x3d739d=yield _0x3a9fae['json']();return new SuccessfulAuthResponse(_0x3d739d);}const _0x4ef965=yield _0x3a9fae['json']();return new FailedAuthResponse(_0x4ef965);}catch(_0x2a65c2){if(_0x2a65c2 instanceof Error)return new FailedAuthResponse({'detail':_0x2a65c2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2a65c2;}});}['refresh'](_0x2a68fe){return __awaiter(this,void 0,void 0,function*(){var _0x5063ea='refresh';try{const _0x339ee0=yield this['fetch']['post'](_0x5063ea,_0x2a68fe,null);if(_0x339ee0['status']>0xc7&&_0x339ee0['status']<0x12c){const _0x54cb3f=yield _0x339ee0['json']();return new SuccessfulAuthResponse(_0x54cb3f);}const _0x208b0f=yield _0x339ee0['json']();return new FailedAuthResponse(_0x208b0f);}catch(_0x342a15){if(_0x342a15 instanceof Error)return new FailedAuthResponse({'detail':_0x342a15['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x342a15;}});}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x462942,_0x2fd0f2,_0x40ebb4,_0x15e7dc){function _0x1c3b19(_0x64e57b){return _0x64e57b instanceof _0x40ebb4?_0x64e57b:new _0x40ebb4(function(_0x3efadf){_0x3efadf(_0x64e57b);});}return new(_0x40ebb4||(_0x40ebb4=Promise))(function(_0x25c3f6,_0x37f727){function _0x1c46b5(_0x2a21fe){try{_0x2caedd(_0x15e7dc['next'](_0x2a21fe));}catch(_0xc8fbb6){_0x37f727(_0xc8fbb6);}}function _0x277615(_0x5d976a){try{_0x2caedd(_0x15e7dc['throw'](_0x5d976a));}catch(_0x300a84){_0x37f727(_0x300a84);}}function _0x2caedd(_0x314ca8){_0x314ca8['done']?_0x25c3f6(_0x314ca8['value']):_0x1c3b19(_0x314ca8['value'])['then'](_0x1c46b5,_0x277615);}_0x2caedd((_0x15e7dc=_0x15e7dc['apply'](_0x462942,_0x2fd0f2||[]))['next']());});};class AdminClient{constructor(_0x39ab1f='https://admin.searchability.dev/'){var _0x26a9fa=new Fetch(_0x39ab1f);this['Accounts']=new AccountService(_0x26a9fa),this['Lists']=new ListService(_0x26a9fa),this['ApiKeys']=new ApiKeyService(_0x26a9fa);}}class AuthClient{constructor(_0x16fabb='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x16fabb);}['login'](_0x5cad49){return __awaiter(this,void 0,void 0,function*(){var _0x47637f='login/'+_0x5cad49;try{const _0x43edcf=yield yield fetch(_0x47637f);if(_0x43edcf['status']>0xc7&&_0x43edcf['status']<0x12c){const _0x37398a=yield _0x43edcf['json']();return new SuccessfulAuthResponse(_0x37398a);}const _0x1f11d9=yield _0x43edcf['json']();return new FailedAuthResponse(_0x1f11d9);}catch(_0x43d6cc){if(_0x43d6cc instanceof Error)return new FailedAuthResponse({'detail':_0x43d6cc['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x43d6cc;}});}['refresh'](_0x3ae2d6){return __awaiter(this,void 0,void 0,function*(){var _0x6bba69='refresh';try{const _0x3effd9=yield this['fetch']['post'](_0x6bba69,_0x3ae2d6,null);if(_0x3effd9['status']>0xc7&&_0x3effd9['status']<0x12c){const _0x33db1f=yield _0x3effd9['json']();return new SuccessfulAuthResponse(_0x33db1f);}const _0x5c377a=yield _0x3effd9['json']();return new FailedAuthResponse(_0x5c377a);}catch(_0x196024){if(_0x196024 instanceof Error)return new FailedAuthResponse({'detail':_0x196024['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x196024;}});}}
14
14
 
15
15
  export { AdminClient, AuthClient, TokenManager };
package/dist/types.d.ts CHANGED
@@ -17,7 +17,8 @@ declare class AccountService {
17
17
  declare class ApiKeyService {
18
18
  readonly fetch: Fetch;
19
19
  constructor(fetch: Fetch);
20
- create(accountName: string, apiKeyName: string, access_token: string): Promise<Response<ApiKey, Problem>>;
20
+ create(account_name: string, api_key_Name: string, access_token: string): Promise<Response<ApiKey, Problem>>;
21
+ view(account_name: string, api_key_name: string, access_token: string): Promise<Response<ApiKeyValue, Problem>>;
21
22
  }
22
23
 
23
24
  declare class ListService {
@@ -67,6 +68,10 @@ type ApiKey = {
67
68
  name: string;
68
69
  created: number;
69
70
  };
71
+ type ApiKeyValue = {
72
+ value: string;
73
+ version: number;
74
+ };
70
75
  type Error = {
71
76
  [key: string]: string[];
72
77
  };
@@ -127,5 +132,17 @@ declare class FailedApiKeyResponse extends Response<ApiKey, Problem> {
127
132
  toSuccess(): ApiKey;
128
133
  toProblem(): Problem;
129
134
  }
135
+ declare class SuccessfulApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
136
+ readonly apiKeyValue: ApiKeyValue;
137
+ constructor(apiKeyValue: ApiKeyValue);
138
+ toSuccess(): ApiKeyValue;
139
+ toProblem(): Problem;
140
+ }
141
+ declare class FailedApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
142
+ readonly problem: Problem;
143
+ constructor(problem: Problem);
144
+ toSuccess(): ApiKeyValue;
145
+ toProblem(): Problem;
146
+ }
130
147
 
131
- export { type Account, AdminClient, type ApiKey, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, TokenManager, type Tokens };
148
+ export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, TokenManager, type Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -1,15 +0,0 @@
1
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x339245,_0x35008f,_0x1c30f1,_0x771fc8){function _0x295ce1(_0x1f8641){return _0x1f8641 instanceof _0x1c30f1?_0x1f8641:new _0x1c30f1(function(_0x3b5b2b){_0x3b5b2b(_0x1f8641);});}return new(_0x1c30f1||(_0x1c30f1=Promise))(function(_0x3bd65,_0x3de036){function _0x3e5e0e(_0x241429){try{_0x10044b(_0x771fc8['next'](_0x241429));}catch(_0x407c7d){_0x3de036(_0x407c7d);}}function _0x24baa5(_0x4a57c1){try{_0x10044b(_0x771fc8['throw'](_0x4a57c1));}catch(_0x27195b){_0x3de036(_0x27195b);}}function _0x10044b(_0x520300){_0x520300['done']?_0x3bd65(_0x520300['value']):_0x295ce1(_0x520300['value'])['then'](_0x3e5e0e,_0x24baa5);}_0x10044b((_0x771fc8=_0x771fc8['apply'](_0x339245,_0x35008f||[]))['next']());});};class TokenManager{constructor(_0xafa69b){this['authClient']=_0xafa69b;}['getOrRefreshTokens'](_0x4c5e7b){return __awaiter$5(this,void 0,void 0,function*(){if(Date['now']()<_0x4c5e7b['access_expires'])return new SuccessfulAuthResponse(_0x4c5e7b);if(Date['now']()<_0x4c5e7b['refresh_expires'])return yield this['authClient']['refresh'](_0x4c5e7b['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
2
-
3
- class Response{constructor(_0x378742){this['isSuccess']=_0x378742;}}class SuccessfulAccountResponse extends Response{constructor(_0x5622a2){super(!![]),this['account']=_0x5622a2;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1a9490){super(![]),this['problem']=_0x1a9490;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x3872bb){super(!![]),this['tokens']=_0x3872bb;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x5571be){super(![]),this['problem']=_0x5571be;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x8412b3){super(!![]),this['apiKey']=_0x8412b3;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x36a6d4){super(![]),this['problem']=_0x36a6d4;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
-
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x1bfd63,_0x8d3a68,_0x28124f,_0x4550fd){function _0x130762(_0x3af8b0){return _0x3af8b0 instanceof _0x28124f?_0x3af8b0:new _0x28124f(function(_0x1e61a9){_0x1e61a9(_0x3af8b0);});}return new(_0x28124f||(_0x28124f=Promise))(function(_0x4a2453,_0x5e788b){function _0x33cf3a(_0x52008f){try{_0x4a922c(_0x4550fd['next'](_0x52008f));}catch(_0x2c2d2f){_0x5e788b(_0x2c2d2f);}}function _0xf47496(_0x1bb064){try{_0x4a922c(_0x4550fd['throw'](_0x1bb064));}catch(_0x4cd66c){_0x5e788b(_0x4cd66c);}}function _0x4a922c(_0x260519){_0x260519['done']?_0x4a2453(_0x260519['value']):_0x130762(_0x260519['value'])['then'](_0x33cf3a,_0xf47496);}_0x4a922c((_0x4550fd=_0x4550fd['apply'](_0x1bfd63,_0x8d3a68||[]))['next']());});};class AccountService{constructor(_0x4d77b9){this['fetch']=_0x4d77b9;}['get'](_0x16faec,_0x5818d2){return __awaiter$4(this,void 0,void 0,function*(){const _0x57c869='Account/'+_0x16faec+'/',_0x455684=yield this['fetch']['get'](_0x57c869,_0x5818d2);try{if(_0x455684['status']>0xc7&&_0x455684['status']<0x12c){const _0x532007=yield _0x455684['json']();return new SuccessfulAccountResponse(_0x532007);}const _0x187847=yield _0x455684['json']();return new FailedAccountResponse(_0x187847);}catch(_0x3f19e5){if(_0x3f19e5 instanceof Error)return new FailedAccountResponse({'detail':_0x3f19e5['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3f19e5;}});}}
6
-
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x55bcf8,_0xf2438e,_0x2a1731,_0x48f293){function _0x733e6c(_0x2d41bf){return _0x2d41bf instanceof _0x2a1731?_0x2d41bf:new _0x2a1731(function(_0x51daff){_0x51daff(_0x2d41bf);});}return new(_0x2a1731||(_0x2a1731=Promise))(function(_0x5602bd,_0x3c1ac3){function _0x4e002c(_0x48e7d4){try{_0x5f5b83(_0x48f293['next'](_0x48e7d4));}catch(_0x35052f){_0x3c1ac3(_0x35052f);}}function _0x39e3b9(_0x4e67b0){try{_0x5f5b83(_0x48f293['throw'](_0x4e67b0));}catch(_0x5d069c){_0x3c1ac3(_0x5d069c);}}function _0x5f5b83(_0x370615){_0x370615['done']?_0x5602bd(_0x370615['value']):_0x733e6c(_0x370615['value'])['then'](_0x4e002c,_0x39e3b9);}_0x5f5b83((_0x48f293=_0x48f293['apply'](_0x55bcf8,_0xf2438e||[]))['next']());});};class ApiKeyService{constructor(_0x24b75a){this['fetch']=_0x24b75a;}['create'](_0x114de0,_0x3c4275,_0x23ab0f){return __awaiter$3(this,void 0,void 0,function*(){const _0x5b688b='api-key/create',_0x382f88={'account_name':_0x114de0,'api_key_name':_0x3c4275};try{const _0x1450b0=yield this['fetch']['post'](_0x5b688b,_0x23ab0f,_0x382f88);if(_0x1450b0['status']>0xc7&&_0x1450b0['status']<0x12c){const _0x5e3e4d=yield _0x1450b0['json']();return new SuccessfulApiKeyResponse(_0x5e3e4d);}const _0x4e195a=yield _0x1450b0['json']();return new FailedApiKeyResponse(_0x4e195a);}catch(_0x3196ed){if(_0x3196ed instanceof Error)return new FailedApiKeyResponse({'detail':_0x3196ed['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3196ed;}});}}
8
-
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2ddd23,_0xad4180,_0x39d3ea,_0x1011e3){function _0x1cd313(_0x47b923){return _0x47b923 instanceof _0x39d3ea?_0x47b923:new _0x39d3ea(function(_0x95fcb9){_0x95fcb9(_0x47b923);});}return new(_0x39d3ea||(_0x39d3ea=Promise))(function(_0x575849,_0x41314d){function _0x5552ce(_0x43b657){try{_0x347bb1(_0x1011e3['next'](_0x43b657));}catch(_0x388821){_0x41314d(_0x388821);}}function _0x40127b(_0x1d8d3b){try{_0x347bb1(_0x1011e3['throw'](_0x1d8d3b));}catch(_0x48b06b){_0x41314d(_0x48b06b);}}function _0x347bb1(_0xa70c06){_0xa70c06['done']?_0x575849(_0xa70c06['value']):_0x1cd313(_0xa70c06['value'])['then'](_0x5552ce,_0x40127b);}_0x347bb1((_0x1011e3=_0x1011e3['apply'](_0x2ddd23,_0xad4180||[]))['next']());});};class ListService{constructor(_0x165b56){this['fetch']=_0x165b56;}['add'](_0x3e6182,_0x3cd265,_0x3510f0){return __awaiter$2(this,void 0,void 0,function*(){const _0xad25d2='List',_0x5faf9e={'account_name':_0x3e6182,'list_name':_0x3cd265};try{const _0x1a310e=yield this['fetch']['post'](_0xad25d2,_0x3510f0,_0x5faf9e);if(_0x1a310e['status']>0xc7&&_0x1a310e['status']<0x12c){const _0x5c3362=yield _0x1a310e['json']();return new SuccessfulAccountResponse(_0x5c3362);}const _0x21fb3d=yield _0x1a310e['json']();return new FailedAccountResponse(_0x21fb3d);}catch(_0x3194ed){if(_0x3194ed instanceof Error)return new FailedAccountResponse({'detail':_0x3194ed['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3194ed;}});}['remove'](_0x5f16f9,_0x16c44c,_0x56635e){return __awaiter$2(this,void 0,void 0,function*(){const _0xbccb21='List/'+_0x5f16f9+'/'+_0x16c44c,_0x2daf06=yield this['fetch']['delete'](_0xbccb21,_0x56635e);try{if(_0x2daf06['status']>0xc7&&_0x2daf06['status']<0x12c){const _0x1f1870=yield _0x2daf06['json']();return new SuccessfulAccountResponse(_0x1f1870);}const _0x2c570d=yield _0x2daf06['json']();return new FailedAccountResponse(_0x2c570d);}catch(_0x3e0247){if(_0x3e0247 instanceof Error)return new FailedAccountResponse({'detail':_0x3e0247['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3e0247;}});}}
10
-
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x55e43e,_0x4dba55,_0x4ebdf3,_0x1a6540){function _0x56b8b0(_0x288ca2){return _0x288ca2 instanceof _0x4ebdf3?_0x288ca2:new _0x4ebdf3(function(_0x344bcf){_0x344bcf(_0x288ca2);});}return new(_0x4ebdf3||(_0x4ebdf3=Promise))(function(_0x51f268,_0xf10781){function _0x8e42e8(_0x5a85ac){try{_0x2f21d1(_0x1a6540['next'](_0x5a85ac));}catch(_0x51c8bc){_0xf10781(_0x51c8bc);}}function _0x1daa76(_0x500225){try{_0x2f21d1(_0x1a6540['throw'](_0x500225));}catch(_0x17a020){_0xf10781(_0x17a020);}}function _0x2f21d1(_0x33fc5b){_0x33fc5b['done']?_0x51f268(_0x33fc5b['value']):_0x56b8b0(_0x33fc5b['value'])['then'](_0x8e42e8,_0x1daa76);}_0x2f21d1((_0x1a6540=_0x1a6540['apply'](_0x55e43e,_0x4dba55||[]))['next']());});};class Fetch{constructor(_0x1d668b){this['baseUri']=_0x1d668b,this['getUrl']=_0xe199dc=>{return _0xe199dc['startsWith']('/')&&(_0xe199dc=_0xe199dc['replace']('/','')),''+this['baseUri']+_0xe199dc;},!_0x1d668b['endsWith']('/')&&(_0x1d668b=_0x1d668b+'/');}['get'](_0x39dfa8,_0x3d22c7){return __awaiter$1(this,void 0,void 0,function*(){const _0x1f1127=this['getUrl'](_0x39dfa8);return yield fetch(_0x1f1127,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d22c7}});});}['post'](_0x5b5fe7,_0x5ba66d,_0x20906f){return __awaiter$1(this,void 0,void 0,function*(){const _0x324436=this['getUrl'](_0x5b5fe7);return yield fetch(_0x324436,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5ba66d},'body':_0x20906f?JSON['stringify'](_0x20906f):null});});}['put'](_0x52d13a,_0x3e2d05,_0x6219aa){return __awaiter$1(this,void 0,void 0,function*(){const _0x3650a9=this['getUrl'](_0x52d13a);return yield fetch(_0x3650a9,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3e2d05},'body':_0x6219aa?JSON['stringify'](_0x6219aa):null});});}['delete'](_0x461dec,_0x3bd906){return __awaiter$1(this,void 0,void 0,function*(){const _0x92458a=this['getUrl'](_0x461dec);return yield fetch(_0x92458a,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3bd906}});});}}
12
-
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x38ca31,_0x2d8742,_0xe28702,_0x43e6f3){function _0x31b1a5(_0x323186){return _0x323186 instanceof _0xe28702?_0x323186:new _0xe28702(function(_0x348922){_0x348922(_0x323186);});}return new(_0xe28702||(_0xe28702=Promise))(function(_0x49cfe0,_0x5d99a0){function _0x5c3feb(_0x39323c){try{_0x8fa0f5(_0x43e6f3['next'](_0x39323c));}catch(_0x5c81a4){_0x5d99a0(_0x5c81a4);}}function _0x1eca31(_0x132a04){try{_0x8fa0f5(_0x43e6f3['throw'](_0x132a04));}catch(_0x5dd3d0){_0x5d99a0(_0x5dd3d0);}}function _0x8fa0f5(_0x5e1802){_0x5e1802['done']?_0x49cfe0(_0x5e1802['value']):_0x31b1a5(_0x5e1802['value'])['then'](_0x5c3feb,_0x1eca31);}_0x8fa0f5((_0x43e6f3=_0x43e6f3['apply'](_0x38ca31,_0x2d8742||[]))['next']());});};class AdminClient{constructor(_0x3fa06d='https://admin.searchability.dev/'){var _0x3884b6=new Fetch(_0x3fa06d);this['Accounts']=new AccountService(_0x3884b6),this['Lists']=new ListService(_0x3884b6),this['ApiKeys']=new ApiKeyService(_0x3884b6);}}class AuthClient{constructor(_0x3b57f9='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x3b57f9);}['login'](_0x11777a){return __awaiter(this,void 0,void 0,function*(){var _0x1aa19e='login/'+_0x11777a;try{const _0x3c629b=yield yield fetch(_0x1aa19e);if(_0x3c629b['status']>0xc7&&_0x3c629b['status']<0x12c){const _0x5465e9=yield _0x3c629b['json']();return new SuccessfulAuthResponse(_0x5465e9);}const _0x501246=yield _0x3c629b['json']();return new FailedAuthResponse(_0x501246);}catch(_0x47edd2){if(_0x47edd2 instanceof Error)return new FailedAuthResponse({'detail':_0x47edd2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x47edd2;}});}['refresh'](_0x50d819){return __awaiter(this,void 0,void 0,function*(){var _0x56e24e='refresh';try{const _0x3b14e3=yield this['fetch']['post'](_0x56e24e,_0x50d819,null);if(_0x3b14e3['status']>0xc7&&_0x3b14e3['status']<0x12c){const _0x82a7f=yield _0x3b14e3['json']();return new SuccessfulAuthResponse(_0x82a7f);}const _0x47a347=yield _0x3b14e3['json']();return new FailedAuthResponse(_0x47a347);}catch(_0xef3910){if(_0xef3910 instanceof Error)return new FailedAuthResponse({'detail':_0xef3910['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xef3910;}});}}
14
-
15
- export { AdminClient, AuthClient, TokenManager };