@searchability/admin-client 0.0.12 → 0.0.13

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.
@@ -1,17 +1,17 @@
1
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x3db7f8,_0x519d16,_0x190e6d,_0x575717){function _0x2ea251(_0x2aae8e){return _0x2aae8e instanceof _0x190e6d?_0x2aae8e:new _0x190e6d(function(_0x22ab0d){_0x22ab0d(_0x2aae8e);});}return new(_0x190e6d||(_0x190e6d=Promise))(function(_0x1f8170,_0x4027d1){function _0x369a4b(_0xf72153){try{_0x21082f(_0x575717['next'](_0xf72153));}catch(_0x1b0238){_0x4027d1(_0x1b0238);}}function _0x31b6d2(_0xddac26){try{_0x21082f(_0x575717['throw'](_0xddac26));}catch(_0x51b7f4){_0x4027d1(_0x51b7f4);}}function _0x21082f(_0x224248){_0x224248['done']?_0x1f8170(_0x224248['value']):_0x2ea251(_0x224248['value'])['then'](_0x369a4b,_0x31b6d2);}_0x21082f((_0x575717=_0x575717['apply'](_0x3db7f8,_0x519d16||[]))['next']());});};class Fetch{static['get'](_0x24cc27,_0x293a15){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x24cc27,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x293a15}});});}static['post'](_0x3dd2fc,_0x5ee0ea,_0x3fe0bf){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x3dd2fc,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5ee0ea},'body':_0x3fe0bf?JSON['stringify'](_0x3fe0bf):null});});}static['put'](_0x5a671c,_0x5bd668,_0x5e2225){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x5a671c,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5bd668},'body':_0x5e2225?JSON['stringify'](_0x5e2225):null});});}static['delete'](_0x4a576a,_0x220bff){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x4a576a,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x220bff}});});}}
1
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x15082f,_0x336bbf,_0x35ee0a,_0x3414a0){function _0x38e6c0(_0x44fee0){return _0x44fee0 instanceof _0x35ee0a?_0x44fee0:new _0x35ee0a(function(_0x4c0a73){_0x4c0a73(_0x44fee0);});}return new(_0x35ee0a||(_0x35ee0a=Promise))(function(_0x48bbfb,_0x51c46a){function _0x397cda(_0x4b9fe8){try{_0x364410(_0x3414a0['next'](_0x4b9fe8));}catch(_0xc78ac3){_0x51c46a(_0xc78ac3);}}function _0x4a752c(_0x3666d9){try{_0x364410(_0x3414a0['throw'](_0x3666d9));}catch(_0xbdc8b6){_0x51c46a(_0xbdc8b6);}}function _0x364410(_0x43450d){_0x43450d['done']?_0x48bbfb(_0x43450d['value']):_0x38e6c0(_0x43450d['value'])['then'](_0x397cda,_0x4a752c);}_0x364410((_0x3414a0=_0x3414a0['apply'](_0x15082f,_0x336bbf||[]))['next']());});};class Fetch{constructor(_0x484e4b){this['baseUri']=_0x484e4b,this['getUrl']=_0x197c1b=>{return _0x197c1b['startsWith']('/')&&(_0x197c1b=_0x197c1b['replace']('/','')),''+this['baseUri']+_0x197c1b;},!_0x484e4b['endsWith']('/')&&(_0x484e4b=_0x484e4b+'/');}['get'](_0x38fba0,_0x3a46b6){return __awaiter$4(this,void 0,void 0,function*(){const _0x533463=this['getUrl'](_0x38fba0);return yield fetch(_0x533463,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3a46b6}});});}['post'](_0x181e73,_0x3d362a,_0x5c71bc){return __awaiter$4(this,void 0,void 0,function*(){const _0x1ba9b3=this['getUrl'](_0x181e73);return yield fetch(_0x1ba9b3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d362a},'body':_0x5c71bc?JSON['stringify'](_0x5c71bc):null});});}['put'](_0x36de06,_0xb97608,_0x2e1cc6){return __awaiter$4(this,void 0,void 0,function*(){const _0x427529=this['getUrl'](_0x36de06);return yield fetch(_0x427529,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xb97608},'body':_0x2e1cc6?JSON['stringify'](_0x2e1cc6):null});});}['delete'](_0x1c9b58,_0xbd0d72){return __awaiter$4(this,void 0,void 0,function*(){const _0x59b6af=this['getUrl'](_0x1c9b58);return yield fetch(_0x59b6af,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xbd0d72}});});}}
2
2
 
3
- class Response{constructor(_0x5e0fb9){this['isSuccess']=_0x5e0fb9;}}class SuccessfulAccountResponse extends Response{constructor(_0x412be6){super(!![]),this['account']=_0x412be6;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x25ea99){super(![]),this['problem']=_0x25ea99;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x12ba83){super(!![]),this['tokens']=_0x12ba83;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x40a875){super(![]),this['problem']=_0x40a875;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x1f0135){super(!![]),this['apiKey']=_0x1f0135;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x4f5c5d){super(![]),this['problem']=_0x4f5c5d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
3
+ undefined&&undefined['__awaiter']||function(_0x252153,_0x5acfbe,_0x9d7cb1,_0x5174a3){function _0x3f6a26(_0x1724fc){return _0x1724fc instanceof _0x9d7cb1?_0x1724fc:new _0x9d7cb1(function(_0x33a81e){_0x33a81e(_0x1724fc);});}return new(_0x9d7cb1||(_0x9d7cb1=Promise))(function(_0x3b83f9,_0x22c48f){function _0x8508f3(_0xf098cb){try{_0x308df6(_0x5174a3['next'](_0xf098cb));}catch(_0x58d9ae){_0x22c48f(_0x58d9ae);}}function _0x5c24e8(_0x104658){try{_0x308df6(_0x5174a3['throw'](_0x104658));}catch(_0x97550){_0x22c48f(_0x97550);}}function _0x308df6(_0x29b9fc){_0x29b9fc['done']?_0x3b83f9(_0x29b9fc['value']):_0x3f6a26(_0x29b9fc['value'])['then'](_0x8508f3,_0x5c24e8);}_0x308df6((_0x5174a3=_0x5174a3['apply'](_0x252153,_0x5acfbe||[]))['next']());});};
4
4
 
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2a3a0b,_0x4c2885,_0x5c3989,_0x54c264){function _0x1dd512(_0x10c1bd){return _0x10c1bd instanceof _0x5c3989?_0x10c1bd:new _0x5c3989(function(_0x20bff5){_0x20bff5(_0x10c1bd);});}return new(_0x5c3989||(_0x5c3989=Promise))(function(_0x482fef,_0x543657){function _0x4bf96f(_0x13a4fa){try{_0x293b9a(_0x54c264['next'](_0x13a4fa));}catch(_0x2d51e8){_0x543657(_0x2d51e8);}}function _0x8cf5b2(_0x10c6a3){try{_0x293b9a(_0x54c264['throw'](_0x10c6a3));}catch(_0x309acb){_0x543657(_0x309acb);}}function _0x293b9a(_0x2049ad){_0x2049ad['done']?_0x482fef(_0x2049ad['value']):_0x1dd512(_0x2049ad['value'])['then'](_0x4bf96f,_0x8cf5b2);}_0x293b9a((_0x54c264=_0x54c264['apply'](_0x2a3a0b,_0x4c2885||[]))['next']());});};class AccountService{constructor(_0xdfb499,_0x588b83){this['baseUri']=_0xdfb499,this['tokenManager']=_0x588b83;}['get'](_0x5e6fdb,_0x37aea4){return __awaiter$4(this,arguments,void 0,function*(_0x49859e,_0x3cb50b,_0x2caafc={}){var _0x181221;const _0x2206fd=yield this['tokenManager']['getTokens'](_0x3cb50b,_0x2caafc);if(!_0x2206fd['isSuccess'])return new FailedAccountResponse(_0x2206fd['toProblem']());_0x3cb50b=_0x2206fd['toSuccess']();let _0x437e20=(_0x181221=_0x2caafc['baseUri'])!==null&&_0x181221!==void 0?_0x181221:this['baseUri'];!_0x437e20['endsWith']('/')&&(_0x437e20=_0x437e20+'/');_0x437e20=_0x437e20+'Account/'+_0x49859e+'/';const _0x108e45=yield Fetch['get'](_0x437e20,_0x3cb50b['access_token']);try{if(_0x108e45['status']>0xc7&&_0x108e45['status']<0x12c){const _0x1fc1da=yield _0x108e45['json']();return new SuccessfulAccountResponse(_0x1fc1da);}const _0x2cb778=yield _0x108e45['json']();return new FailedAccountResponse(_0x2cb778);}catch(_0x5c9e10){if(_0x5c9e10 instanceof Error)return new FailedAccountResponse({'detail':_0x5c9e10['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5c9e10;}});}}
5
+ class Response{constructor(_0x580fa0){this['isSuccess']=_0x580fa0;}}class SuccessfulAccountResponse extends Response{constructor(_0x9e525f){super(!![]),this['account']=_0x9e525f;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xd4154b){super(![]),this['problem']=_0xd4154b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x28ef39){super(!![]),this['tokens']=_0x28ef39;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulApiKeyResponse extends Response{constructor(_0x101bbb){super(!![]),this['apiKey']=_0x101bbb;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x41cf66){super(![]),this['problem']=_0x41cf66;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x257172,_0x2258f3,_0x1ae8c6,_0x7afb2f){function _0x165d83(_0x1d80e5){return _0x1d80e5 instanceof _0x1ae8c6?_0x1d80e5:new _0x1ae8c6(function(_0x2c608a){_0x2c608a(_0x1d80e5);});}return new(_0x1ae8c6||(_0x1ae8c6=Promise))(function(_0x3bee7c,_0x192cf2){function _0x4c81de(_0x2c3793){try{_0x45a2be(_0x7afb2f['next'](_0x2c3793));}catch(_0x27a02b){_0x192cf2(_0x27a02b);}}function _0x409aee(_0x479686){try{_0x45a2be(_0x7afb2f['throw'](_0x479686));}catch(_0x1306b3){_0x192cf2(_0x1306b3);}}function _0x45a2be(_0x3215b3){_0x3215b3['done']?_0x3bee7c(_0x3215b3['value']):_0x165d83(_0x3215b3['value'])['then'](_0x4c81de,_0x409aee);}_0x45a2be((_0x7afb2f=_0x7afb2f['apply'](_0x257172,_0x2258f3||[]))['next']());});};class ApiKeyService{constructor(_0x4c5af9,_0x4e30a5){this['baseUri']=_0x4c5af9,this['tokenManager']=_0x4e30a5;}['create'](_0xa87672,_0x565251,_0x4349bb){return __awaiter$3(this,arguments,void 0,function*(_0x4212a9,_0xe59a83,_0x9abf25,_0xb9032a={}){var _0x3b0354;const _0x3522ae=yield this['tokenManager']['getTokens'](_0x9abf25,_0xb9032a);if(!_0x3522ae['isSuccess'])return new FailedApiKeyResponse(_0x3522ae['toProblem']());_0x9abf25=_0x3522ae['toSuccess']();let _0x2235d8=(_0x3b0354=_0xb9032a['baseUri'])!==null&&_0x3b0354!==void 0?_0x3b0354:this['baseUri'];!_0x2235d8['endsWith']('/')&&(_0x2235d8=_0x2235d8+'/');_0x2235d8=_0x2235d8+'ApiKey/Create';const _0x19ae7d={'account_name':_0x4212a9,'name':_0xe59a83};try{const _0x312de3=yield Fetch['post'](_0x2235d8,_0x9abf25['access_token'],_0x19ae7d);if(_0x312de3['status']>0xc7&&_0x312de3['status']<0x12c){const _0x432675=yield _0x312de3['json']();return new SuccessfulApiKeyResponse(_0x432675);}const _0x511805=yield _0x312de3['json']();return new FailedApiKeyResponse(_0x511805);}catch(_0x50b1c0){if(_0x50b1c0 instanceof Error)return new FailedApiKeyResponse({'detail':_0x50b1c0['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x50b1c0;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x5ba142,_0x34b341,_0xe547d0,_0x178cd9){function _0x40a5e2(_0x27d9e9){return _0x27d9e9 instanceof _0xe547d0?_0x27d9e9:new _0xe547d0(function(_0x3bc9c8){_0x3bc9c8(_0x27d9e9);});}return new(_0xe547d0||(_0xe547d0=Promise))(function(_0x132eb5,_0x888c42){function _0x2e7ac3(_0x2546c8){try{_0x5418cc(_0x178cd9['next'](_0x2546c8));}catch(_0x3aa182){_0x888c42(_0x3aa182);}}function _0x2c74cf(_0x1e0a80){try{_0x5418cc(_0x178cd9['throw'](_0x1e0a80));}catch(_0x50e228){_0x888c42(_0x50e228);}}function _0x5418cc(_0xf4e8d5){_0xf4e8d5['done']?_0x132eb5(_0xf4e8d5['value']):_0x40a5e2(_0xf4e8d5['value'])['then'](_0x2e7ac3,_0x2c74cf);}_0x5418cc((_0x178cd9=_0x178cd9['apply'](_0x5ba142,_0x34b341||[]))['next']());});};class AccountService{constructor(_0x322d10,_0x59dbb5){this['tokenManager']=_0x322d10,this['fetch']=_0x59dbb5;}['get'](_0x1f784c){return __awaiter$3(this,arguments,void 0,function*(_0x5c3364,_0x3e0ea5=undefined){const _0x5e80bb=yield this['tokenManager']['getOrRefreshTokens'](_0x3e0ea5);if(!_0x5e80bb['isSuccess'])return new FailedAccountResponse(_0x5e80bb['toProblem']());_0x3e0ea5=_0x5e80bb['toSuccess']();const _0x3226c5='Account/'+_0x5c3364+'/',_0x4bd6f8=yield this['fetch']['get'](_0x3226c5,_0x3e0ea5['access_token']);try{if(_0x4bd6f8['status']>0xc7&&_0x4bd6f8['status']<0x12c){const _0x34c563=yield _0x4bd6f8['json']();return new SuccessfulAccountResponse(_0x34c563);}const _0x1fa8a2=yield _0x4bd6f8['json']();return new FailedAccountResponse(_0x1fa8a2);}catch(_0x5bacd2){if(_0x5bacd2 instanceof Error)return new FailedAccountResponse({'detail':_0x5bacd2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5bacd2;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x48874a,_0x33cfc3,_0xabacf0,_0x130149){function _0x41759c(_0x1af22b){return _0x1af22b instanceof _0xabacf0?_0x1af22b:new _0xabacf0(function(_0x3f18dc){_0x3f18dc(_0x1af22b);});}return new(_0xabacf0||(_0xabacf0=Promise))(function(_0x4455b5,_0x1b888a){function _0x2fd82a(_0x3b7102){try{_0x1e37a1(_0x130149['next'](_0x3b7102));}catch(_0x4cec1b){_0x1b888a(_0x4cec1b);}}function _0x24c303(_0x3c06d8){try{_0x1e37a1(_0x130149['throw'](_0x3c06d8));}catch(_0x124f24){_0x1b888a(_0x124f24);}}function _0x1e37a1(_0x1ef58b){_0x1ef58b['done']?_0x4455b5(_0x1ef58b['value']):_0x41759c(_0x1ef58b['value'])['then'](_0x2fd82a,_0x24c303);}_0x1e37a1((_0x130149=_0x130149['apply'](_0x48874a,_0x33cfc3||[]))['next']());});};class ListService{constructor(_0x5a7e34,_0x544099){this['baseUri']=_0x5a7e34,this['tokenManager']=_0x544099;}['add'](_0x2cd7e1,_0x43d3bd,_0x1aefcf){return __awaiter$2(this,arguments,void 0,function*(_0x197a82,_0xf3525d,_0x41a7c9,_0x13d80f={}){var _0x476d72;const _0x32f4e6=yield this['tokenManager']['getTokens'](_0x41a7c9,_0x13d80f);if(!_0x32f4e6['isSuccess'])return new FailedAccountResponse(_0x32f4e6['toProblem']());_0x41a7c9=_0x32f4e6['toSuccess']();let _0x47cc80=(_0x476d72=_0x13d80f['baseUri'])!==null&&_0x476d72!==void 0?_0x476d72:this['baseUri'];!_0x47cc80['endsWith']('/')&&(_0x47cc80=_0x47cc80+'/');_0x47cc80=_0x47cc80+'List';const _0x311328={'account_name':_0x197a82,'list_name':_0xf3525d};try{const _0x384678=yield Fetch['post'](_0x47cc80,_0x41a7c9['access_token'],_0x311328);if(_0x384678['status']>0xc7&&_0x384678['status']<0x12c){const _0x3efe00=yield _0x384678['json']();return new SuccessfulAccountResponse(_0x3efe00);}const _0x34fcf3=yield _0x384678['json']();return new FailedAccountResponse(_0x34fcf3);}catch(_0x2b0ed2){if(_0x2b0ed2 instanceof Error)return new FailedAccountResponse({'detail':_0x2b0ed2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2b0ed2;}});}['remove'](_0x589d75,_0x56d7e9,_0x9076b4){return __awaiter$2(this,arguments,void 0,function*(_0x3d278a,_0xf374f8,_0x303fc3,_0x40c626={}){var _0xc9f340;const _0x481c5e=yield this['tokenManager']['getTokens'](_0x303fc3,_0x40c626);if(!_0x481c5e['isSuccess'])return new FailedAccountResponse(_0x481c5e['toProblem']());_0x303fc3=_0x481c5e['toSuccess']();let _0x27a239=(_0xc9f340=_0x40c626['baseUri'])!==null&&_0xc9f340!==void 0?_0xc9f340:this['baseUri'];_0x27a239=_0x27a239+'/List/'+_0x3d278a+'/'+_0xf374f8;const _0x341538=yield Fetch['delete'](_0x27a239,_0x303fc3['access_token']);try{if(_0x341538['status']>0xc7&&_0x341538['status']<0x12c){const _0x5a68a9=yield _0x341538['json']();return new SuccessfulAccountResponse(_0x5a68a9);}const _0x205851=yield _0x341538['json']();return new FailedAccountResponse(_0x205851);}catch(_0x1cc62d){if(_0x1cc62d instanceof Error)return new FailedAccountResponse({'detail':_0x1cc62d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1cc62d;}});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x31a2e5,_0x28872c,_0x351dc0,_0x4636cf){function _0x51da1a(_0x44e7f7){return _0x44e7f7 instanceof _0x351dc0?_0x44e7f7:new _0x351dc0(function(_0x146feb){_0x146feb(_0x44e7f7);});}return new(_0x351dc0||(_0x351dc0=Promise))(function(_0x166067,_0x2d7086){function _0x128b1d(_0x276e8c){try{_0x38a387(_0x4636cf['next'](_0x276e8c));}catch(_0x350d55){_0x2d7086(_0x350d55);}}function _0x5c407c(_0x3cc574){try{_0x38a387(_0x4636cf['throw'](_0x3cc574));}catch(_0x7b94b5){_0x2d7086(_0x7b94b5);}}function _0x38a387(_0x3e0197){_0x3e0197['done']?_0x166067(_0x3e0197['value']):_0x51da1a(_0x3e0197['value'])['then'](_0x128b1d,_0x5c407c);}_0x38a387((_0x4636cf=_0x4636cf['apply'](_0x31a2e5,_0x28872c||[]))['next']());});};class ApiKeyService{constructor(_0x366161,_0x3a52ae){this['tokenManager']=_0x366161,this['fetch']=_0x3a52ae;}['create'](_0x1bef50,_0x439638,_0x2148a2){return __awaiter$2(this,void 0,void 0,function*(){const _0x164f0a=yield this['tokenManager']['getOrRefreshTokens'](_0x2148a2);if(!_0x164f0a['isSuccess'])return new FailedApiKeyResponse(_0x164f0a['toProblem']());_0x2148a2=_0x164f0a['toSuccess']();const _0x27260b='ApiKey/Create',_0x16a987={'account_name':_0x1bef50,'name':_0x439638};try{const _0x57efdc=yield this['fetch']['post'](_0x27260b,_0x2148a2['access_token'],_0x16a987);if(_0x57efdc['status']>0xc7&&_0x57efdc['status']<0x12c){const _0x755c86=yield _0x57efdc['json']();return new SuccessfulApiKeyResponse(_0x755c86);}const _0x570714=yield _0x57efdc['json']();return new FailedApiKeyResponse(_0x570714);}catch(_0x331e05){if(_0x331e05 instanceof Error)return new FailedApiKeyResponse({'detail':_0x331e05['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x331e05;}});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x19eeb0,_0x43588e,_0x3e8c8d,_0x285d61){function _0x556cff(_0x3270b1){return _0x3270b1 instanceof _0x3e8c8d?_0x3270b1:new _0x3e8c8d(function(_0x561b32){_0x561b32(_0x3270b1);});}return new(_0x3e8c8d||(_0x3e8c8d=Promise))(function(_0x39fb4e,_0x2eedc6){function _0x2f77b2(_0x13ffa2){try{_0x2b5592(_0x285d61['next'](_0x13ffa2));}catch(_0x258fa3){_0x2eedc6(_0x258fa3);}}function _0x5778b0(_0x240ad3){try{_0x2b5592(_0x285d61['throw'](_0x240ad3));}catch(_0x148978){_0x2eedc6(_0x148978);}}function _0x2b5592(_0x550d1b){_0x550d1b['done']?_0x39fb4e(_0x550d1b['value']):_0x556cff(_0x550d1b['value'])['then'](_0x2f77b2,_0x5778b0);}_0x2b5592((_0x285d61=_0x285d61['apply'](_0x19eeb0,_0x43588e||[]))['next']());});};class TokenManager{constructor(_0x14894f){this['tokenService']=_0x14894f,this['getTokens']=(_0x13a6da,..._0x266ad6)=>__awaiter$1(this,[_0x13a6da,..._0x266ad6],void 0,function*(_0x34598d,_0x3384bc={}){if(_0x34598d){var _0x703495=yield this['refreshIfExpired'](_0x34598d,_0x3384bc);if(_0x703495['isSuccess'])return _0x703495;}return yield this['tokenService']['get'](_0x3384bc);});}['refreshIfExpired'](_0x32344c){return __awaiter$1(this,arguments,void 0,function*(_0x236e80,_0x1aaf00={}){if(Date['now']()<_0x236e80['access_expires'])return new SuccessfulRefreshResponse(_0x236e80);if(Date['now']()>_0x236e80['refresh_expires']){const _0x26312d={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x26312d);}return yield this['tokenService']['refresh'](_0x236e80['refresh_token'],_0x1aaf00);});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2dc0a4,_0xe00b29,_0x50f7eb,_0x368d5d){function _0x4285b3(_0x43b4f8){return _0x43b4f8 instanceof _0x50f7eb?_0x43b4f8:new _0x50f7eb(function(_0x4b05f2){_0x4b05f2(_0x43b4f8);});}return new(_0x50f7eb||(_0x50f7eb=Promise))(function(_0x246088,_0x111a2e){function _0x3fde91(_0x3b9f1c){try{_0x170560(_0x368d5d['next'](_0x3b9f1c));}catch(_0x4dff87){_0x111a2e(_0x4dff87);}}function _0x1131a1(_0x2c1631){try{_0x170560(_0x368d5d['throw'](_0x2c1631));}catch(_0x42f152){_0x111a2e(_0x42f152);}}function _0x170560(_0xb8d01c){_0xb8d01c['done']?_0x246088(_0xb8d01c['value']):_0x4285b3(_0xb8d01c['value'])['then'](_0x3fde91,_0x1131a1);}_0x170560((_0x368d5d=_0x368d5d['apply'](_0x2dc0a4,_0xe00b29||[]))['next']());});};class ListService{constructor(_0x4b8c34,_0xd648a1){this['tokenManager']=_0x4b8c34,this['fetch']=_0xd648a1;}['add'](_0x5527e8,_0x46b53b,_0x330c2a){return __awaiter$1(this,void 0,void 0,function*(){const _0x3b7a5a=yield this['tokenManager']['getOrRefreshTokens'](_0x330c2a);if(!_0x3b7a5a['isSuccess'])return new FailedAccountResponse(_0x3b7a5a['toProblem']());_0x330c2a=_0x3b7a5a['toSuccess']();const _0x5cb2ce='List',_0x366d80={'account_name':_0x5527e8,'list_name':_0x46b53b};try{const _0x2b5eeb=yield this['fetch']['post'](_0x5cb2ce,_0x330c2a['access_token'],_0x366d80);if(_0x2b5eeb['status']>0xc7&&_0x2b5eeb['status']<0x12c){const _0x4884f7=yield _0x2b5eeb['json']();return new SuccessfulAccountResponse(_0x4884f7);}const _0x191f78=yield _0x2b5eeb['json']();return new FailedAccountResponse(_0x191f78);}catch(_0x4e9b1f){if(_0x4e9b1f instanceof Error)return new FailedAccountResponse({'detail':_0x4e9b1f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4e9b1f;}});}['remove'](_0x336fd9,_0x3f05b4,_0x470c93){return __awaiter$1(this,void 0,void 0,function*(){const _0x15f143=yield this['tokenManager']['getOrRefreshTokens'](_0x470c93);if(!_0x15f143['isSuccess'])return new FailedAccountResponse(_0x15f143['toProblem']());_0x470c93=_0x15f143['toSuccess']();const _0x45827d='List/'+_0x336fd9+'/'+_0x3f05b4,_0x5e5967=yield this['fetch']['delete'](_0x45827d,_0x470c93['access_token']);try{if(_0x5e5967['status']>0xc7&&_0x5e5967['status']<0x12c){const _0x4825ac=yield _0x5e5967['json']();return new SuccessfulAccountResponse(_0x4825ac);}const _0x39c873=yield _0x5e5967['json']();return new FailedAccountResponse(_0x39c873);}catch(_0x2f0c12){if(_0x2f0c12 instanceof Error)return new FailedAccountResponse({'detail':_0x2f0c12['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2f0c12;}});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x536c23,_0x50aafa,_0x8c3e9,_0xb7acf9){function _0x40f3cd(_0x337ba3){return _0x337ba3 instanceof _0x8c3e9?_0x337ba3:new _0x8c3e9(function(_0x4d0183){_0x4d0183(_0x337ba3);});}return new(_0x8c3e9||(_0x8c3e9=Promise))(function(_0x4ca12a,_0x5dfa67){function _0x131242(_0x142814){try{_0x515114(_0xb7acf9['next'](_0x142814));}catch(_0x2356a0){_0x5dfa67(_0x2356a0);}}function _0x3d9dd1(_0x421890){try{_0x515114(_0xb7acf9['throw'](_0x421890));}catch(_0x4143d6){_0x5dfa67(_0x4143d6);}}function _0x515114(_0x419793){_0x419793['done']?_0x4ca12a(_0x419793['value']):_0x40f3cd(_0x419793['value'])['then'](_0x131242,_0x3d9dd1);}_0x515114((_0xb7acf9=_0xb7acf9['apply'](_0x536c23,_0x50aafa||[]))['next']());});};class TokenService{constructor(_0x538475,_0x407802){this['apiKey']=_0x538475,this['baseUri']=_0x407802;}['get'](){return __awaiter(this,arguments,void 0,function*(_0x294224={}){var _0x3f4a6f;if(!this['apiKey'])return new FailedRefreshResponse({'detail':'API\x20Key\x20required.','title':'','status':0x193,'instance':'','type':''});let _0x2e95f6=(_0x3f4a6f=_0x294224['baseUri'])!==null&&_0x3f4a6f!==void 0?_0x3f4a6f:this['baseUri'];!_0x2e95f6['endsWith']('/')&&(_0x2e95f6=_0x2e95f6+'/');_0x2e95f6=_0x2e95f6+'tokens/get/'+this['apiKey'];try{const _0x33f820=yield yield fetch(_0x2e95f6,{'method':'POST','headers':{'Content-Type':'application/json'}});if(_0x33f820['status']>0xc7&&_0x33f820['status']<0x12c){const _0x58404f=yield _0x33f820['json']();return new SuccessfulRefreshResponse(_0x58404f);}const _0x3db970=yield _0x33f820['json']();return new FailedRefreshResponse(_0x3db970);}catch(_0x129754){if(_0x129754 instanceof Error)return new FailedRefreshResponse({'detail':_0x129754['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x129754;}});}['refresh'](_0x110ad1){return __awaiter(this,arguments,void 0,function*(_0x463bc5,_0x2979ac={}){var _0x503861;let _0x15cdf8=(_0x503861=_0x2979ac['baseUri'])!==null&&_0x503861!==void 0?_0x503861:this['baseUri'];!_0x15cdf8['endsWith']('/')&&(_0x15cdf8=_0x15cdf8+'/');_0x15cdf8=_0x15cdf8+'Tokens/Refresh';try{const _0xa01055=yield Fetch['post'](_0x15cdf8,_0x463bc5,null);if(_0xa01055['status']>0xc7&&_0xa01055['status']<0x12c){const _0x4466d4=yield _0xa01055['json']();return new SuccessfulRefreshResponse(_0x4466d4);}const _0x34ae32=yield _0xa01055['json']();return new FailedRefreshResponse(_0x34ae32);}catch(_0x1eab25){if(_0x1eab25 instanceof Error)return new FailedRefreshResponse({'detail':_0x1eab25['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1eab25;}});}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x43465f,_0xc6046b,_0x4484bc,_0x3df6bc){function _0x29e539(_0x2e24ab){return _0x2e24ab instanceof _0x4484bc?_0x2e24ab:new _0x4484bc(function(_0x27ba2d){_0x27ba2d(_0x2e24ab);});}return new(_0x4484bc||(_0x4484bc=Promise))(function(_0x393973,_0x754509){function _0x53f666(_0x2cd9af){try{_0x5641f8(_0x3df6bc['next'](_0x2cd9af));}catch(_0x1a9234){_0x754509(_0x1a9234);}}function _0x36df33(_0x17d7a6){try{_0x5641f8(_0x3df6bc['throw'](_0x17d7a6));}catch(_0x113409){_0x754509(_0x113409);}}function _0x5641f8(_0x567fe0){_0x567fe0['done']?_0x393973(_0x567fe0['value']):_0x29e539(_0x567fe0['value'])['then'](_0x53f666,_0x36df33);}_0x5641f8((_0x3df6bc=_0x3df6bc['apply'](_0x43465f,_0xc6046b||[]))['next']());});};class TokenManager{constructor(_0x38113f){this['authClient']=_0x38113f;}['getOrRefreshTokens'](_0x291a63){return __awaiter(this,void 0,void 0,function*(){if(!_0x291a63)return this['authClient']['login']();if(Date['now']()<_0x291a63['access_expires'])return new SuccessfulAuthResponse(_0x291a63);if(Date['now']()>_0x291a63['refresh_expires'])return yield this['authClient']['refresh'](_0x291a63['refresh_token']);return this['authClient']['login']();});}}
14
14
 
15
- class AdminClient{constructor(_0x29c0ae,_0x500a69='https://admin.searchability.dev/'){this['apiKey']=_0x29c0ae,this['baseUri']=_0x500a69,this['Tokens']=new TokenService(_0x29c0ae,this['baseUri']);const _0x51b257=new TokenManager(this['Tokens']);this['Accounts']=new AccountService(this['baseUri'],_0x51b257),this['Lists']=new ListService(this['baseUri'],_0x51b257),this['ApiKeys']=new ApiKeyService(this['baseUri'],_0x51b257);}}
15
+ class AdminClient{constructor(_0x47d7a1,_0x4ecc7a='https://admin.searchability.dev/'){var _0x4c902c=new TokenManager(_0x47d7a1),_0xe65f23=new Fetch(_0x4ecc7a);this['Accounts']=new AccountService(_0x4c902c,_0xe65f23),this['Lists']=new ListService(_0x4c902c,_0xe65f23),this['ApiKeys']=new ApiKeyService(_0x4c902c,_0xe65f23);}}
16
16
 
17
- export { AdminClient };
17
+ export { AdminClient as default };
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x1a16bb,_0x3ed95e,_0x5bc546,_0xa9341){function _0x1aae76(_0x2e9a5d){return _0x2e9a5d instanceof _0x5bc546?_0x2e9a5d:new _0x5bc546(function(_0x195b57){_0x195b57(_0x2e9a5d);});}return new(_0x5bc546||(_0x5bc546=Promise))(function(_0x465dea,_0x5ab5aa){function _0x10916a(_0x22b0de){try{_0xe94020(_0xa9341['next'](_0x22b0de));}catch(_0x25976c){_0x5ab5aa(_0x25976c);}}function _0x3bab88(_0x3da958){try{_0xe94020(_0xa9341['throw'](_0x3da958));}catch(_0x5cf63d){_0x5ab5aa(_0x5cf63d);}}function _0xe94020(_0x5a4c4b){_0x5a4c4b['done']?_0x465dea(_0x5a4c4b['value']):_0x1aae76(_0x5a4c4b['value'])['then'](_0x10916a,_0x3bab88);}_0xe94020((_0xa9341=_0xa9341['apply'](_0x1a16bb,_0x3ed95e||[]))['next']());});};class Fetch{static['get'](_0x5d2bfc,_0x247774){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x5d2bfc,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x247774}});});}static['post'](_0xf08e42,_0xe9aaf4,_0x3bb478){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0xf08e42,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xe9aaf4},'body':_0x3bb478?JSON['stringify'](_0x3bb478):null});});}static['put'](_0xf65514,_0x504d78,_0x25c970){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0xf65514,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x504d78},'body':_0x25c970?JSON['stringify'](_0x25c970):null});});}static['delete'](_0x2c3dec,_0x2e19dc){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x2c3dec,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2e19dc}});});}}
3
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x414e3b,_0x2c6189,_0x471348,_0x3a9525){function _0x4c2be0(_0x3bfdbd){return _0x3bfdbd instanceof _0x471348?_0x3bfdbd:new _0x471348(function(_0x2b679b){_0x2b679b(_0x3bfdbd);});}return new(_0x471348||(_0x471348=Promise))(function(_0x5ee39b,_0x247078){function _0x470e0b(_0x4b0faf){try{_0x33dca6(_0x3a9525['next'](_0x4b0faf));}catch(_0x3aa045){_0x247078(_0x3aa045);}}function _0x4db0d6(_0x37b761){try{_0x33dca6(_0x3a9525['throw'](_0x37b761));}catch(_0x5f1f9f){_0x247078(_0x5f1f9f);}}function _0x33dca6(_0x156965){_0x156965['done']?_0x5ee39b(_0x156965['value']):_0x4c2be0(_0x156965['value'])['then'](_0x470e0b,_0x4db0d6);}_0x33dca6((_0x3a9525=_0x3a9525['apply'](_0x414e3b,_0x2c6189||[]))['next']());});};class Fetch{constructor(_0x702f5f){this['baseUri']=_0x702f5f,this['getUrl']=_0x53f15e=>{return _0x53f15e['startsWith']('/')&&(_0x53f15e=_0x53f15e['replace']('/','')),''+this['baseUri']+_0x53f15e;},!_0x702f5f['endsWith']('/')&&(_0x702f5f=_0x702f5f+'/');}['get'](_0x2ee506,_0x3a49cd){return __awaiter$4(this,void 0,void 0,function*(){const _0x2aa67c=this['getUrl'](_0x2ee506);return yield fetch(_0x2aa67c,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3a49cd}});});}['post'](_0x311f8d,_0x20a870,_0x51f24f){return __awaiter$4(this,void 0,void 0,function*(){const _0x367f8d=this['getUrl'](_0x311f8d);return yield fetch(_0x367f8d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x20a870},'body':_0x51f24f?JSON['stringify'](_0x51f24f):null});});}['put'](_0x1ba2c8,_0x573e43,_0x5f3a8d){return __awaiter$4(this,void 0,void 0,function*(){const _0x5c14f9=this['getUrl'](_0x1ba2c8);return yield fetch(_0x5c14f9,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x573e43},'body':_0x5f3a8d?JSON['stringify'](_0x5f3a8d):null});});}['delete'](_0x3b586e,_0x159f63){return __awaiter$4(this,void 0,void 0,function*(){const _0x5b15ab=this['getUrl'](_0x3b586e);return yield fetch(_0x5b15ab,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x159f63}});});}}
4
4
 
5
- class Response{constructor(_0x34c8fa){this['isSuccess']=_0x34c8fa;}}class SuccessfulAccountResponse extends Response{constructor(_0x19bdf2){super(!![]),this['account']=_0x19bdf2;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x42c1f6){super(![]),this['problem']=_0x42c1f6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x38cc3c){super(!![]),this['tokens']=_0x38cc3c;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x44d24a){super(![]),this['problem']=_0x44d24a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x7b1088){super(!![]),this['apiKey']=_0x7b1088;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x507bad){super(![]),this['problem']=_0x507bad;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
5
+ undefined&&undefined['__awaiter']||function(_0x498c12,_0x2ff5da,_0x53b644,_0x582909){function _0x167528(_0x13892c){return _0x13892c instanceof _0x53b644?_0x13892c:new _0x53b644(function(_0x9d887){_0x9d887(_0x13892c);});}return new(_0x53b644||(_0x53b644=Promise))(function(_0x1ee67d,_0x427b20){function _0x16e386(_0x47051b){try{_0x4790b8(_0x582909['next'](_0x47051b));}catch(_0x59fc49){_0x427b20(_0x59fc49);}}function _0x37ce8c(_0x23ab8f){try{_0x4790b8(_0x582909['throw'](_0x23ab8f));}catch(_0x18f662){_0x427b20(_0x18f662);}}function _0x4790b8(_0x39392d){_0x39392d['done']?_0x1ee67d(_0x39392d['value']):_0x167528(_0x39392d['value'])['then'](_0x16e386,_0x37ce8c);}_0x4790b8((_0x582909=_0x582909['apply'](_0x498c12,_0x2ff5da||[]))['next']());});};
6
6
 
7
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x208de1,_0x4f55ac,_0x28256d,_0x39904f){function _0x193bf9(_0x334bea){return _0x334bea instanceof _0x28256d?_0x334bea:new _0x28256d(function(_0xca7c58){_0xca7c58(_0x334bea);});}return new(_0x28256d||(_0x28256d=Promise))(function(_0x15da21,_0x1cf68d){function _0x446e4b(_0x3f4833){try{_0x262748(_0x39904f['next'](_0x3f4833));}catch(_0x16fda6){_0x1cf68d(_0x16fda6);}}function _0x29319b(_0x2631db){try{_0x262748(_0x39904f['throw'](_0x2631db));}catch(_0x3f9319){_0x1cf68d(_0x3f9319);}}function _0x262748(_0x4c1c5a){_0x4c1c5a['done']?_0x15da21(_0x4c1c5a['value']):_0x193bf9(_0x4c1c5a['value'])['then'](_0x446e4b,_0x29319b);}_0x262748((_0x39904f=_0x39904f['apply'](_0x208de1,_0x4f55ac||[]))['next']());});};class AccountService{constructor(_0x286890,_0x23ae88){this['baseUri']=_0x286890,this['tokenManager']=_0x23ae88;}['get'](_0x3bba4f,_0xf455f1){return __awaiter$4(this,arguments,void 0,function*(_0xec868,_0x42e21a,_0xf6cce7={}){var _0x101963;const _0x430fa4=yield this['tokenManager']['getTokens'](_0x42e21a,_0xf6cce7);if(!_0x430fa4['isSuccess'])return new FailedAccountResponse(_0x430fa4['toProblem']());_0x42e21a=_0x430fa4['toSuccess']();let _0x1ea932=(_0x101963=_0xf6cce7['baseUri'])!==null&&_0x101963!==void 0?_0x101963:this['baseUri'];!_0x1ea932['endsWith']('/')&&(_0x1ea932=_0x1ea932+'/');_0x1ea932=_0x1ea932+'Account/'+_0xec868+'/';const _0x48bfba=yield Fetch['get'](_0x1ea932,_0x42e21a['access_token']);try{if(_0x48bfba['status']>0xc7&&_0x48bfba['status']<0x12c){const _0x22d293=yield _0x48bfba['json']();return new SuccessfulAccountResponse(_0x22d293);}const _0xe94bef=yield _0x48bfba['json']();return new FailedAccountResponse(_0xe94bef);}catch(_0x85ab80){if(_0x85ab80 instanceof Error)return new FailedAccountResponse({'detail':_0x85ab80['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x85ab80;}});}}
7
+ class Response{constructor(_0x4207a0){this['isSuccess']=_0x4207a0;}}class SuccessfulAccountResponse extends Response{constructor(_0x1ed12c){super(!![]),this['account']=_0x1ed12c;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x18a505){super(![]),this['problem']=_0x18a505;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x50b18e){super(!![]),this['tokens']=_0x50b18e;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulApiKeyResponse extends Response{constructor(_0x2f7507){super(!![]),this['apiKey']=_0x2f7507;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x19302d){super(![]),this['problem']=_0x19302d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
8
8
 
9
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x34a31f,_0x2d48a1,_0x543dd7,_0x2c3b29){function _0xe0013(_0x4e061f){return _0x4e061f instanceof _0x543dd7?_0x4e061f:new _0x543dd7(function(_0x43a3d5){_0x43a3d5(_0x4e061f);});}return new(_0x543dd7||(_0x543dd7=Promise))(function(_0xb9e918,_0x4f5b7a){function _0x2e0cee(_0x1074b0){try{_0x239188(_0x2c3b29['next'](_0x1074b0));}catch(_0x4b96b3){_0x4f5b7a(_0x4b96b3);}}function _0x163d78(_0x4ff35d){try{_0x239188(_0x2c3b29['throw'](_0x4ff35d));}catch(_0x56ae8f){_0x4f5b7a(_0x56ae8f);}}function _0x239188(_0xd6e10e){_0xd6e10e['done']?_0xb9e918(_0xd6e10e['value']):_0xe0013(_0xd6e10e['value'])['then'](_0x2e0cee,_0x163d78);}_0x239188((_0x2c3b29=_0x2c3b29['apply'](_0x34a31f,_0x2d48a1||[]))['next']());});};class ApiKeyService{constructor(_0x2c7883,_0x30a2f){this['baseUri']=_0x2c7883,this['tokenManager']=_0x30a2f;}['create'](_0x17433d,_0x60bb54,_0x47dca1){return __awaiter$3(this,arguments,void 0,function*(_0x5bb962,_0x5dfff5,_0x34ceac,_0x3dce6c={}){var _0xff1006;const _0x10f634=yield this['tokenManager']['getTokens'](_0x34ceac,_0x3dce6c);if(!_0x10f634['isSuccess'])return new FailedApiKeyResponse(_0x10f634['toProblem']());_0x34ceac=_0x10f634['toSuccess']();let _0x5bff8f=(_0xff1006=_0x3dce6c['baseUri'])!==null&&_0xff1006!==void 0?_0xff1006:this['baseUri'];!_0x5bff8f['endsWith']('/')&&(_0x5bff8f=_0x5bff8f+'/');_0x5bff8f=_0x5bff8f+'ApiKey/Create';const _0x632562={'account_name':_0x5bb962,'name':_0x5dfff5};try{const _0x1aaf2b=yield Fetch['post'](_0x5bff8f,_0x34ceac['access_token'],_0x632562);if(_0x1aaf2b['status']>0xc7&&_0x1aaf2b['status']<0x12c){const _0x2cd654=yield _0x1aaf2b['json']();return new SuccessfulApiKeyResponse(_0x2cd654);}const _0x294f16=yield _0x1aaf2b['json']();return new FailedApiKeyResponse(_0x294f16);}catch(_0x54d8bb){if(_0x54d8bb instanceof Error)return new FailedApiKeyResponse({'detail':_0x54d8bb['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x54d8bb;}});}}
9
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0xd05870,_0x462616,_0x1afdb8,_0x135588){function _0xe44751(_0x46bde0){return _0x46bde0 instanceof _0x1afdb8?_0x46bde0:new _0x1afdb8(function(_0x1dd587){_0x1dd587(_0x46bde0);});}return new(_0x1afdb8||(_0x1afdb8=Promise))(function(_0x4c15e2,_0x10e909){function _0x37f668(_0x27a633){try{_0x1ba528(_0x135588['next'](_0x27a633));}catch(_0x3cff05){_0x10e909(_0x3cff05);}}function _0x533aaa(_0x33cf05){try{_0x1ba528(_0x135588['throw'](_0x33cf05));}catch(_0x5d338a){_0x10e909(_0x5d338a);}}function _0x1ba528(_0x24eb9e){_0x24eb9e['done']?_0x4c15e2(_0x24eb9e['value']):_0xe44751(_0x24eb9e['value'])['then'](_0x37f668,_0x533aaa);}_0x1ba528((_0x135588=_0x135588['apply'](_0xd05870,_0x462616||[]))['next']());});};class AccountService{constructor(_0x39b365,_0x28f7f0){this['tokenManager']=_0x39b365,this['fetch']=_0x28f7f0;}['get'](_0x3683b9){return __awaiter$3(this,arguments,void 0,function*(_0x1bdc83,_0x1044f5=undefined){const _0x1f49bc=yield this['tokenManager']['getOrRefreshTokens'](_0x1044f5);if(!_0x1f49bc['isSuccess'])return new FailedAccountResponse(_0x1f49bc['toProblem']());_0x1044f5=_0x1f49bc['toSuccess']();const _0x485cac='Account/'+_0x1bdc83+'/',_0xff4409=yield this['fetch']['get'](_0x485cac,_0x1044f5['access_token']);try{if(_0xff4409['status']>0xc7&&_0xff4409['status']<0x12c){const _0x4ab5df=yield _0xff4409['json']();return new SuccessfulAccountResponse(_0x4ab5df);}const _0x732b8d=yield _0xff4409['json']();return new FailedAccountResponse(_0x732b8d);}catch(_0x1ee629){if(_0x1ee629 instanceof Error)return new FailedAccountResponse({'detail':_0x1ee629['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1ee629;}});}}
10
10
 
11
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x480775,_0x5ce97f,_0x4304d4,_0xb77505){function _0xd1f09(_0x2a7834){return _0x2a7834 instanceof _0x4304d4?_0x2a7834:new _0x4304d4(function(_0x301221){_0x301221(_0x2a7834);});}return new(_0x4304d4||(_0x4304d4=Promise))(function(_0x5ac6cb,_0x1d77d0){function _0x46040a(_0x2d2a55){try{_0x1e4859(_0xb77505['next'](_0x2d2a55));}catch(_0xb93247){_0x1d77d0(_0xb93247);}}function _0x187260(_0x2a4616){try{_0x1e4859(_0xb77505['throw'](_0x2a4616));}catch(_0x5772ff){_0x1d77d0(_0x5772ff);}}function _0x1e4859(_0x23b52c){_0x23b52c['done']?_0x5ac6cb(_0x23b52c['value']):_0xd1f09(_0x23b52c['value'])['then'](_0x46040a,_0x187260);}_0x1e4859((_0xb77505=_0xb77505['apply'](_0x480775,_0x5ce97f||[]))['next']());});};class ListService{constructor(_0x32a39e,_0x4d3e1c){this['baseUri']=_0x32a39e,this['tokenManager']=_0x4d3e1c;}['add'](_0x220e25,_0x437b04,_0x17bdbd){return __awaiter$2(this,arguments,void 0,function*(_0x4be3bf,_0x5a19e0,_0x462fe3,_0x570ab4={}){var _0x27af56;const _0x261084=yield this['tokenManager']['getTokens'](_0x462fe3,_0x570ab4);if(!_0x261084['isSuccess'])return new FailedAccountResponse(_0x261084['toProblem']());_0x462fe3=_0x261084['toSuccess']();let _0x211cf6=(_0x27af56=_0x570ab4['baseUri'])!==null&&_0x27af56!==void 0?_0x27af56:this['baseUri'];!_0x211cf6['endsWith']('/')&&(_0x211cf6=_0x211cf6+'/');_0x211cf6=_0x211cf6+'List';const _0x5dac98={'account_name':_0x4be3bf,'list_name':_0x5a19e0};try{const _0x2d6bd2=yield Fetch['post'](_0x211cf6,_0x462fe3['access_token'],_0x5dac98);if(_0x2d6bd2['status']>0xc7&&_0x2d6bd2['status']<0x12c){const _0x2a0003=yield _0x2d6bd2['json']();return new SuccessfulAccountResponse(_0x2a0003);}const _0x4f05d2=yield _0x2d6bd2['json']();return new FailedAccountResponse(_0x4f05d2);}catch(_0x56b9cc){if(_0x56b9cc instanceof Error)return new FailedAccountResponse({'detail':_0x56b9cc['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x56b9cc;}});}['remove'](_0x4e23b6,_0x1d5a4c,_0x1171e3){return __awaiter$2(this,arguments,void 0,function*(_0x4825bd,_0x7f7ede,_0x1f1d41,_0xd07701={}){var _0x50b445;const _0x2f9f98=yield this['tokenManager']['getTokens'](_0x1f1d41,_0xd07701);if(!_0x2f9f98['isSuccess'])return new FailedAccountResponse(_0x2f9f98['toProblem']());_0x1f1d41=_0x2f9f98['toSuccess']();let _0x100675=(_0x50b445=_0xd07701['baseUri'])!==null&&_0x50b445!==void 0?_0x50b445:this['baseUri'];_0x100675=_0x100675+'/List/'+_0x4825bd+'/'+_0x7f7ede;const _0x5c9151=yield Fetch['delete'](_0x100675,_0x1f1d41['access_token']);try{if(_0x5c9151['status']>0xc7&&_0x5c9151['status']<0x12c){const _0x28ad5e=yield _0x5c9151['json']();return new SuccessfulAccountResponse(_0x28ad5e);}const _0x34cb04=yield _0x5c9151['json']();return new FailedAccountResponse(_0x34cb04);}catch(_0x33ca49){if(_0x33ca49 instanceof Error)return new FailedAccountResponse({'detail':_0x33ca49['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x33ca49;}});}}
11
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0xf3fe6,_0x522853,_0x1727e2,_0x18a6d8){function _0x53bf4f(_0x318cdd){return _0x318cdd instanceof _0x1727e2?_0x318cdd:new _0x1727e2(function(_0x3053b4){_0x3053b4(_0x318cdd);});}return new(_0x1727e2||(_0x1727e2=Promise))(function(_0x585ab8,_0x1f6212){function _0x500f24(_0x3d2538){try{_0x3ce18c(_0x18a6d8['next'](_0x3d2538));}catch(_0x3a3afd){_0x1f6212(_0x3a3afd);}}function _0x39661b(_0x1810b2){try{_0x3ce18c(_0x18a6d8['throw'](_0x1810b2));}catch(_0x21fe5b){_0x1f6212(_0x21fe5b);}}function _0x3ce18c(_0xa64772){_0xa64772['done']?_0x585ab8(_0xa64772['value']):_0x53bf4f(_0xa64772['value'])['then'](_0x500f24,_0x39661b);}_0x3ce18c((_0x18a6d8=_0x18a6d8['apply'](_0xf3fe6,_0x522853||[]))['next']());});};class ApiKeyService{constructor(_0x479d88,_0x21503e){this['tokenManager']=_0x479d88,this['fetch']=_0x21503e;}['create'](_0x452b7c,_0x3b892b,_0x325e98){return __awaiter$2(this,void 0,void 0,function*(){const _0x520a29=yield this['tokenManager']['getOrRefreshTokens'](_0x325e98);if(!_0x520a29['isSuccess'])return new FailedApiKeyResponse(_0x520a29['toProblem']());_0x325e98=_0x520a29['toSuccess']();const _0x593d51='ApiKey/Create',_0x5b29a0={'account_name':_0x452b7c,'name':_0x3b892b};try{const _0x51bcc7=yield this['fetch']['post'](_0x593d51,_0x325e98['access_token'],_0x5b29a0);if(_0x51bcc7['status']>0xc7&&_0x51bcc7['status']<0x12c){const _0x5e320d=yield _0x51bcc7['json']();return new SuccessfulApiKeyResponse(_0x5e320d);}const _0x4f217b=yield _0x51bcc7['json']();return new FailedApiKeyResponse(_0x4f217b);}catch(_0x356b0a){if(_0x356b0a instanceof Error)return new FailedApiKeyResponse({'detail':_0x356b0a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x356b0a;}});}}
12
12
 
13
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xc35cdb,_0x3802dd,_0xef1b7f,_0x1ec398){function _0x484d43(_0xf026dd){return _0xf026dd instanceof _0xef1b7f?_0xf026dd:new _0xef1b7f(function(_0x2d56c8){_0x2d56c8(_0xf026dd);});}return new(_0xef1b7f||(_0xef1b7f=Promise))(function(_0x608f91,_0x150cc5){function _0x116d8d(_0x42e3d6){try{_0x51b8d6(_0x1ec398['next'](_0x42e3d6));}catch(_0x260ad7){_0x150cc5(_0x260ad7);}}function _0x108f54(_0x10a9ff){try{_0x51b8d6(_0x1ec398['throw'](_0x10a9ff));}catch(_0x4c4dad){_0x150cc5(_0x4c4dad);}}function _0x51b8d6(_0x4197a5){_0x4197a5['done']?_0x608f91(_0x4197a5['value']):_0x484d43(_0x4197a5['value'])['then'](_0x116d8d,_0x108f54);}_0x51b8d6((_0x1ec398=_0x1ec398['apply'](_0xc35cdb,_0x3802dd||[]))['next']());});};class TokenManager{constructor(_0x157d9c){this['tokenService']=_0x157d9c,this['getTokens']=(_0x107655,..._0x47a260)=>__awaiter$1(this,[_0x107655,..._0x47a260],void 0,function*(_0x579b42,_0x1252be={}){if(_0x579b42){var _0x34fb97=yield this['refreshIfExpired'](_0x579b42,_0x1252be);if(_0x34fb97['isSuccess'])return _0x34fb97;}return yield this['tokenService']['get'](_0x1252be);});}['refreshIfExpired'](_0x30625b){return __awaiter$1(this,arguments,void 0,function*(_0x5e2316,_0x1ed1da={}){if(Date['now']()<_0x5e2316['access_expires'])return new SuccessfulRefreshResponse(_0x5e2316);if(Date['now']()>_0x5e2316['refresh_expires']){const _0x3d4289={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x3d4289);}return yield this['tokenService']['refresh'](_0x5e2316['refresh_token'],_0x1ed1da);});}}
13
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x115648,_0x1f61b3,_0x326669,_0x1c541b){function _0x2ab187(_0x5df156){return _0x5df156 instanceof _0x326669?_0x5df156:new _0x326669(function(_0x5db72f){_0x5db72f(_0x5df156);});}return new(_0x326669||(_0x326669=Promise))(function(_0x2907fa,_0xe0319a){function _0x4427c7(_0x27aec0){try{_0x5ceee6(_0x1c541b['next'](_0x27aec0));}catch(_0x3c57f9){_0xe0319a(_0x3c57f9);}}function _0x5b5bd1(_0x56aefa){try{_0x5ceee6(_0x1c541b['throw'](_0x56aefa));}catch(_0x2dc97e){_0xe0319a(_0x2dc97e);}}function _0x5ceee6(_0x4a265f){_0x4a265f['done']?_0x2907fa(_0x4a265f['value']):_0x2ab187(_0x4a265f['value'])['then'](_0x4427c7,_0x5b5bd1);}_0x5ceee6((_0x1c541b=_0x1c541b['apply'](_0x115648,_0x1f61b3||[]))['next']());});};class ListService{constructor(_0x5422a6,_0x5d34c2){this['tokenManager']=_0x5422a6,this['fetch']=_0x5d34c2;}['add'](_0x196430,_0x2e2b6e,_0x44b238){return __awaiter$1(this,void 0,void 0,function*(){const _0x401245=yield this['tokenManager']['getOrRefreshTokens'](_0x44b238);if(!_0x401245['isSuccess'])return new FailedAccountResponse(_0x401245['toProblem']());_0x44b238=_0x401245['toSuccess']();const _0x3c7713='List',_0x168bc9={'account_name':_0x196430,'list_name':_0x2e2b6e};try{const _0x276d16=yield this['fetch']['post'](_0x3c7713,_0x44b238['access_token'],_0x168bc9);if(_0x276d16['status']>0xc7&&_0x276d16['status']<0x12c){const _0x4c4a5b=yield _0x276d16['json']();return new SuccessfulAccountResponse(_0x4c4a5b);}const _0x4fb0be=yield _0x276d16['json']();return new FailedAccountResponse(_0x4fb0be);}catch(_0x5727d4){if(_0x5727d4 instanceof Error)return new FailedAccountResponse({'detail':_0x5727d4['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5727d4;}});}['remove'](_0x4fd02d,_0x1013f5,_0x483a7c){return __awaiter$1(this,void 0,void 0,function*(){const _0x351c87=yield this['tokenManager']['getOrRefreshTokens'](_0x483a7c);if(!_0x351c87['isSuccess'])return new FailedAccountResponse(_0x351c87['toProblem']());_0x483a7c=_0x351c87['toSuccess']();const _0x20ddaf='List/'+_0x4fd02d+'/'+_0x1013f5,_0x3ebc85=yield this['fetch']['delete'](_0x20ddaf,_0x483a7c['access_token']);try{if(_0x3ebc85['status']>0xc7&&_0x3ebc85['status']<0x12c){const _0x7e7beb=yield _0x3ebc85['json']();return new SuccessfulAccountResponse(_0x7e7beb);}const _0x129997=yield _0x3ebc85['json']();return new FailedAccountResponse(_0x129997);}catch(_0x1d5ab4){if(_0x1d5ab4 instanceof Error)return new FailedAccountResponse({'detail':_0x1d5ab4['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1d5ab4;}});}}
14
14
 
15
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x447375,_0x68c7b6,_0x2f4ca8,_0x14046b){function _0x4ace0c(_0x24665c){return _0x24665c instanceof _0x2f4ca8?_0x24665c:new _0x2f4ca8(function(_0x1514e2){_0x1514e2(_0x24665c);});}return new(_0x2f4ca8||(_0x2f4ca8=Promise))(function(_0x3fc474,_0x146262){function _0x3917f6(_0x550774){try{_0x4666df(_0x14046b['next'](_0x550774));}catch(_0x14266c){_0x146262(_0x14266c);}}function _0xcea89a(_0x2c07d4){try{_0x4666df(_0x14046b['throw'](_0x2c07d4));}catch(_0x44e283){_0x146262(_0x44e283);}}function _0x4666df(_0x4e9695){_0x4e9695['done']?_0x3fc474(_0x4e9695['value']):_0x4ace0c(_0x4e9695['value'])['then'](_0x3917f6,_0xcea89a);}_0x4666df((_0x14046b=_0x14046b['apply'](_0x447375,_0x68c7b6||[]))['next']());});};class TokenService{constructor(_0x1aae91,_0x505628){this['apiKey']=_0x1aae91,this['baseUri']=_0x505628;}['get'](){return __awaiter(this,arguments,void 0,function*(_0x40a395={}){var _0x556432;if(!this['apiKey'])return new FailedRefreshResponse({'detail':'API\x20Key\x20required.','title':'','status':0x193,'instance':'','type':''});let _0x4d08ed=(_0x556432=_0x40a395['baseUri'])!==null&&_0x556432!==void 0?_0x556432:this['baseUri'];!_0x4d08ed['endsWith']('/')&&(_0x4d08ed=_0x4d08ed+'/');_0x4d08ed=_0x4d08ed+'tokens/get/'+this['apiKey'];try{const _0x365fcb=yield yield fetch(_0x4d08ed,{'method':'POST','headers':{'Content-Type':'application/json'}});if(_0x365fcb['status']>0xc7&&_0x365fcb['status']<0x12c){const _0x5dc663=yield _0x365fcb['json']();return new SuccessfulRefreshResponse(_0x5dc663);}const _0x4ec846=yield _0x365fcb['json']();return new FailedRefreshResponse(_0x4ec846);}catch(_0x413c77){if(_0x413c77 instanceof Error)return new FailedRefreshResponse({'detail':_0x413c77['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x413c77;}});}['refresh'](_0x1e02d3){return __awaiter(this,arguments,void 0,function*(_0x37ad23,_0x3bfd36={}){var _0x356fb8;let _0x303b9f=(_0x356fb8=_0x3bfd36['baseUri'])!==null&&_0x356fb8!==void 0?_0x356fb8:this['baseUri'];!_0x303b9f['endsWith']('/')&&(_0x303b9f=_0x303b9f+'/');_0x303b9f=_0x303b9f+'Tokens/Refresh';try{const _0x56174c=yield Fetch['post'](_0x303b9f,_0x37ad23,null);if(_0x56174c['status']>0xc7&&_0x56174c['status']<0x12c){const _0x4c2975=yield _0x56174c['json']();return new SuccessfulRefreshResponse(_0x4c2975);}const _0x2b5cb4=yield _0x56174c['json']();return new FailedRefreshResponse(_0x2b5cb4);}catch(_0x6f9bdc){if(_0x6f9bdc instanceof Error)return new FailedRefreshResponse({'detail':_0x6f9bdc['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x6f9bdc;}});}}
15
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x1fd8cc,_0x3578c4,_0x50b790,_0x3d9fad){function _0x205eaf(_0xa1af6c){return _0xa1af6c instanceof _0x50b790?_0xa1af6c:new _0x50b790(function(_0x33e8af){_0x33e8af(_0xa1af6c);});}return new(_0x50b790||(_0x50b790=Promise))(function(_0x4b22fd,_0x43251b){function _0x1ca094(_0x106dfb){try{_0x221909(_0x3d9fad['next'](_0x106dfb));}catch(_0x3528c3){_0x43251b(_0x3528c3);}}function _0x274de7(_0x22e6e0){try{_0x221909(_0x3d9fad['throw'](_0x22e6e0));}catch(_0x54cb0b){_0x43251b(_0x54cb0b);}}function _0x221909(_0x5116b6){_0x5116b6['done']?_0x4b22fd(_0x5116b6['value']):_0x205eaf(_0x5116b6['value'])['then'](_0x1ca094,_0x274de7);}_0x221909((_0x3d9fad=_0x3d9fad['apply'](_0x1fd8cc,_0x3578c4||[]))['next']());});};class TokenManager{constructor(_0x27c6c5){this['authClient']=_0x27c6c5;}['getOrRefreshTokens'](_0x100a4e){return __awaiter(this,void 0,void 0,function*(){if(!_0x100a4e)return this['authClient']['login']();if(Date['now']()<_0x100a4e['access_expires'])return new SuccessfulAuthResponse(_0x100a4e);if(Date['now']()>_0x100a4e['refresh_expires'])return yield this['authClient']['refresh'](_0x100a4e['refresh_token']);return this['authClient']['login']();});}}
16
16
 
17
- class AdminClient{constructor(_0x595dfc,_0x35bd75='https://admin.searchability.dev/'){this['apiKey']=_0x595dfc,this['baseUri']=_0x35bd75,this['Tokens']=new TokenService(_0x595dfc,this['baseUri']);const _0xd510b8=new TokenManager(this['Tokens']);this['Accounts']=new AccountService(this['baseUri'],_0xd510b8),this['Lists']=new ListService(this['baseUri'],_0xd510b8),this['ApiKeys']=new ApiKeyService(this['baseUri'],_0xd510b8);}}
17
+ class AdminClient{constructor(_0x5c5712,_0x4e0104='https://admin.searchability.dev/'){var _0x31cd59=new TokenManager(_0x5c5712),_0x17881a=new Fetch(_0x4e0104);this['Accounts']=new AccountService(_0x31cd59,_0x17881a),this['Lists']=new ListService(_0x31cd59,_0x17881a),this['ApiKeys']=new ApiKeyService(_0x31cd59,_0x17881a);}}
18
18
 
19
- exports.AdminClient = AdminClient;
19
+ module.exports = AdminClient;
@@ -1,17 +1,17 @@
1
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x34c543,_0x27c93a,_0x10a771,_0x2bd1ac){function _0x51fc70(_0x233086){return _0x233086 instanceof _0x10a771?_0x233086:new _0x10a771(function(_0x2ccbe6){_0x2ccbe6(_0x233086);});}return new(_0x10a771||(_0x10a771=Promise))(function(_0x486108,_0x5f29af){function _0x5c68b4(_0x3603e8){try{_0x4e3a1c(_0x2bd1ac['next'](_0x3603e8));}catch(_0x3d781a){_0x5f29af(_0x3d781a);}}function _0x3519f2(_0x126acf){try{_0x4e3a1c(_0x2bd1ac['throw'](_0x126acf));}catch(_0x3cc6d9){_0x5f29af(_0x3cc6d9);}}function _0x4e3a1c(_0x559701){_0x559701['done']?_0x486108(_0x559701['value']):_0x51fc70(_0x559701['value'])['then'](_0x5c68b4,_0x3519f2);}_0x4e3a1c((_0x2bd1ac=_0x2bd1ac['apply'](_0x34c543,_0x27c93a||[]))['next']());});};class Fetch{static['get'](_0x4a4e6a,_0x462eb3){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x4a4e6a,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x462eb3}});});}static['post'](_0x2a6311,_0xafd1b2,_0x741874){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x2a6311,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xafd1b2},'body':_0x741874?JSON['stringify'](_0x741874):null});});}static['put'](_0x1fe27c,_0x2ed1ac,_0x17c359){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x1fe27c,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2ed1ac},'body':_0x17c359?JSON['stringify'](_0x17c359):null});});}static['delete'](_0x374772,_0xd96057){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x374772,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xd96057}});});}}
1
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x54a3ba,_0x6a08ac,_0x3a4cfa,_0x34240f){function _0x414419(_0x407379){return _0x407379 instanceof _0x3a4cfa?_0x407379:new _0x3a4cfa(function(_0xa94ef1){_0xa94ef1(_0x407379);});}return new(_0x3a4cfa||(_0x3a4cfa=Promise))(function(_0x507097,_0x314a38){function _0x5b82be(_0x2b6ec4){try{_0x46ddb6(_0x34240f['next'](_0x2b6ec4));}catch(_0x16ff8b){_0x314a38(_0x16ff8b);}}function _0xb46638(_0x5ddb7c){try{_0x46ddb6(_0x34240f['throw'](_0x5ddb7c));}catch(_0x45c90b){_0x314a38(_0x45c90b);}}function _0x46ddb6(_0x310c18){_0x310c18['done']?_0x507097(_0x310c18['value']):_0x414419(_0x310c18['value'])['then'](_0x5b82be,_0xb46638);}_0x46ddb6((_0x34240f=_0x34240f['apply'](_0x54a3ba,_0x6a08ac||[]))['next']());});};class Fetch{constructor(_0x3741e4){this['baseUri']=_0x3741e4,this['getUrl']=_0x126bad=>{return _0x126bad['startsWith']('/')&&(_0x126bad=_0x126bad['replace']('/','')),''+this['baseUri']+_0x126bad;},!_0x3741e4['endsWith']('/')&&(_0x3741e4=_0x3741e4+'/');}['get'](_0x32c494,_0x10f54b){return __awaiter$4(this,void 0,void 0,function*(){const _0x326eb8=this['getUrl'](_0x32c494);return yield fetch(_0x326eb8,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x10f54b}});});}['post'](_0x21aac1,_0x1b6124,_0x260392){return __awaiter$4(this,void 0,void 0,function*(){const _0x22ecfd=this['getUrl'](_0x21aac1);return yield fetch(_0x22ecfd,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1b6124},'body':_0x260392?JSON['stringify'](_0x260392):null});});}['put'](_0x58b953,_0x545c86,_0x44fd3e){return __awaiter$4(this,void 0,void 0,function*(){const _0xbdc5f=this['getUrl'](_0x58b953);return yield fetch(_0xbdc5f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x545c86},'body':_0x44fd3e?JSON['stringify'](_0x44fd3e):null});});}['delete'](_0x842269,_0x3bcca0){return __awaiter$4(this,void 0,void 0,function*(){const _0x49b368=this['getUrl'](_0x842269);return yield fetch(_0x49b368,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3bcca0}});});}}
2
2
 
3
- class Response{constructor(_0x146e81){this['isSuccess']=_0x146e81;}}class SuccessfulAccountResponse extends Response{constructor(_0x3e8833){super(!![]),this['account']=_0x3e8833;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1e63df){super(![]),this['problem']=_0x1e63df;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x450085){super(!![]),this['tokens']=_0x450085;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x3c28bb){super(![]),this['problem']=_0x3c28bb;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x5425e7){super(!![]),this['apiKey']=_0x5425e7;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x48ef26){super(![]),this['problem']=_0x48ef26;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
3
+ undefined&&undefined['__awaiter']||function(_0x1dc762,_0x29bf73,_0x29768b,_0x3d6c8c){function _0x172b88(_0x16eb18){return _0x16eb18 instanceof _0x29768b?_0x16eb18:new _0x29768b(function(_0x46af5a){_0x46af5a(_0x16eb18);});}return new(_0x29768b||(_0x29768b=Promise))(function(_0x2bd3cc,_0x10b567){function _0x7c2b4b(_0x297a46){try{_0x2ab791(_0x3d6c8c['next'](_0x297a46));}catch(_0x2bca73){_0x10b567(_0x2bca73);}}function _0x147a68(_0x1a43d8){try{_0x2ab791(_0x3d6c8c['throw'](_0x1a43d8));}catch(_0x492a0a){_0x10b567(_0x492a0a);}}function _0x2ab791(_0x23351f){_0x23351f['done']?_0x2bd3cc(_0x23351f['value']):_0x172b88(_0x23351f['value'])['then'](_0x7c2b4b,_0x147a68);}_0x2ab791((_0x3d6c8c=_0x3d6c8c['apply'](_0x1dc762,_0x29bf73||[]))['next']());});};
4
4
 
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0xa32245,_0x3e0ee0,_0xb36618,_0x55f9b0){function _0x55103a(_0x38ed57){return _0x38ed57 instanceof _0xb36618?_0x38ed57:new _0xb36618(function(_0xb392ae){_0xb392ae(_0x38ed57);});}return new(_0xb36618||(_0xb36618=Promise))(function(_0x1d58ff,_0x154363){function _0x46038d(_0x4df016){try{_0x362672(_0x55f9b0['next'](_0x4df016));}catch(_0x12bf8d){_0x154363(_0x12bf8d);}}function _0x25812a(_0x5a369b){try{_0x362672(_0x55f9b0['throw'](_0x5a369b));}catch(_0x309735){_0x154363(_0x309735);}}function _0x362672(_0x17368e){_0x17368e['done']?_0x1d58ff(_0x17368e['value']):_0x55103a(_0x17368e['value'])['then'](_0x46038d,_0x25812a);}_0x362672((_0x55f9b0=_0x55f9b0['apply'](_0xa32245,_0x3e0ee0||[]))['next']());});};class AccountService{constructor(_0x2eed21,_0x18d263){this['baseUri']=_0x2eed21,this['tokenManager']=_0x18d263;}['get'](_0x32a909,_0x45982d){return __awaiter$4(this,arguments,void 0,function*(_0x25b278,_0x276fa6,_0x2418d7={}){var _0x3aaead;const _0x234979=yield this['tokenManager']['getTokens'](_0x276fa6,_0x2418d7);if(!_0x234979['isSuccess'])return new FailedAccountResponse(_0x234979['toProblem']());_0x276fa6=_0x234979['toSuccess']();let _0x3f411a=(_0x3aaead=_0x2418d7['baseUri'])!==null&&_0x3aaead!==void 0?_0x3aaead:this['baseUri'];!_0x3f411a['endsWith']('/')&&(_0x3f411a=_0x3f411a+'/');_0x3f411a=_0x3f411a+'Account/'+_0x25b278+'/';const _0x4ad4c9=yield Fetch['get'](_0x3f411a,_0x276fa6['access_token']);try{if(_0x4ad4c9['status']>0xc7&&_0x4ad4c9['status']<0x12c){const _0x536a3d=yield _0x4ad4c9['json']();return new SuccessfulAccountResponse(_0x536a3d);}const _0x310a25=yield _0x4ad4c9['json']();return new FailedAccountResponse(_0x310a25);}catch(_0x2034a4){if(_0x2034a4 instanceof Error)return new FailedAccountResponse({'detail':_0x2034a4['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2034a4;}});}}
5
+ class Response{constructor(_0x40fe64){this['isSuccess']=_0x40fe64;}}class SuccessfulAccountResponse extends Response{constructor(_0x1055bf){super(!![]),this['account']=_0x1055bf;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x5c2cd9){super(![]),this['problem']=_0x5c2cd9;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x3572c2){super(!![]),this['tokens']=_0x3572c2;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulApiKeyResponse extends Response{constructor(_0xa5284a){super(!![]),this['apiKey']=_0xa5284a;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x506510){super(![]),this['problem']=_0x506510;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x58dc28,_0x5bd0e3,_0x5e388f,_0x31e992){function _0x1fbcad(_0x2abf68){return _0x2abf68 instanceof _0x5e388f?_0x2abf68:new _0x5e388f(function(_0x15471a){_0x15471a(_0x2abf68);});}return new(_0x5e388f||(_0x5e388f=Promise))(function(_0x4f4d15,_0xf0db87){function _0x111340(_0x154957){try{_0x3df890(_0x31e992['next'](_0x154957));}catch(_0x4e6c1e){_0xf0db87(_0x4e6c1e);}}function _0x25816d(_0xda2c81){try{_0x3df890(_0x31e992['throw'](_0xda2c81));}catch(_0x58a0e6){_0xf0db87(_0x58a0e6);}}function _0x3df890(_0x20207a){_0x20207a['done']?_0x4f4d15(_0x20207a['value']):_0x1fbcad(_0x20207a['value'])['then'](_0x111340,_0x25816d);}_0x3df890((_0x31e992=_0x31e992['apply'](_0x58dc28,_0x5bd0e3||[]))['next']());});};class ApiKeyService{constructor(_0x40a11e,_0x125a63){this['baseUri']=_0x40a11e,this['tokenManager']=_0x125a63;}['create'](_0x4a5534,_0x4f32ea,_0x5b75ca){return __awaiter$3(this,arguments,void 0,function*(_0x2d8f0a,_0x50f43a,_0x2ba555,_0x3a286e={}){var _0x2e2592;const _0x39932f=yield this['tokenManager']['getTokens'](_0x2ba555,_0x3a286e);if(!_0x39932f['isSuccess'])return new FailedApiKeyResponse(_0x39932f['toProblem']());_0x2ba555=_0x39932f['toSuccess']();let _0x29736e=(_0x2e2592=_0x3a286e['baseUri'])!==null&&_0x2e2592!==void 0?_0x2e2592:this['baseUri'];!_0x29736e['endsWith']('/')&&(_0x29736e=_0x29736e+'/');_0x29736e=_0x29736e+'ApiKey/Create';const _0x338256={'account_name':_0x2d8f0a,'name':_0x50f43a};try{const _0x482470=yield Fetch['post'](_0x29736e,_0x2ba555['access_token'],_0x338256);if(_0x482470['status']>0xc7&&_0x482470['status']<0x12c){const _0x1d5599=yield _0x482470['json']();return new SuccessfulApiKeyResponse(_0x1d5599);}const _0x1a3143=yield _0x482470['json']();return new FailedApiKeyResponse(_0x1a3143);}catch(_0x2e8e76){if(_0x2e8e76 instanceof Error)return new FailedApiKeyResponse({'detail':_0x2e8e76['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2e8e76;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3ea6e5,_0x3fa476,_0x4ffc62,_0x4e4f27){function _0x441c73(_0x5de365){return _0x5de365 instanceof _0x4ffc62?_0x5de365:new _0x4ffc62(function(_0x40dd25){_0x40dd25(_0x5de365);});}return new(_0x4ffc62||(_0x4ffc62=Promise))(function(_0x14f6ab,_0xdfc493){function _0x1a9081(_0x5adfa3){try{_0x14b22b(_0x4e4f27['next'](_0x5adfa3));}catch(_0x2a4473){_0xdfc493(_0x2a4473);}}function _0x114b93(_0x7488d2){try{_0x14b22b(_0x4e4f27['throw'](_0x7488d2));}catch(_0x192a99){_0xdfc493(_0x192a99);}}function _0x14b22b(_0x5ce7e1){_0x5ce7e1['done']?_0x14f6ab(_0x5ce7e1['value']):_0x441c73(_0x5ce7e1['value'])['then'](_0x1a9081,_0x114b93);}_0x14b22b((_0x4e4f27=_0x4e4f27['apply'](_0x3ea6e5,_0x3fa476||[]))['next']());});};class AccountService{constructor(_0x35b8a8,_0x455b35){this['tokenManager']=_0x35b8a8,this['fetch']=_0x455b35;}['get'](_0x3e7c53){return __awaiter$3(this,arguments,void 0,function*(_0x8ce88e,_0x472094=undefined){const _0x39393a=yield this['tokenManager']['getOrRefreshTokens'](_0x472094);if(!_0x39393a['isSuccess'])return new FailedAccountResponse(_0x39393a['toProblem']());_0x472094=_0x39393a['toSuccess']();const _0x31346f='Account/'+_0x8ce88e+'/',_0x325ddb=yield this['fetch']['get'](_0x31346f,_0x472094['access_token']);try{if(_0x325ddb['status']>0xc7&&_0x325ddb['status']<0x12c){const _0x7517f3=yield _0x325ddb['json']();return new SuccessfulAccountResponse(_0x7517f3);}const _0x480eb8=yield _0x325ddb['json']();return new FailedAccountResponse(_0x480eb8);}catch(_0x19888a){if(_0x19888a instanceof Error)return new FailedAccountResponse({'detail':_0x19888a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x19888a;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x40ca37,_0x7752e3,_0x51ccbd,_0xdeeb29){function _0x44739f(_0x51799c){return _0x51799c instanceof _0x51ccbd?_0x51799c:new _0x51ccbd(function(_0x478155){_0x478155(_0x51799c);});}return new(_0x51ccbd||(_0x51ccbd=Promise))(function(_0x1240c9,_0x32a8f9){function _0xb67ce1(_0x2a15e2){try{_0x501dd6(_0xdeeb29['next'](_0x2a15e2));}catch(_0x3a386a){_0x32a8f9(_0x3a386a);}}function _0x470c12(_0x2487bd){try{_0x501dd6(_0xdeeb29['throw'](_0x2487bd));}catch(_0x1e8fa2){_0x32a8f9(_0x1e8fa2);}}function _0x501dd6(_0x48a739){_0x48a739['done']?_0x1240c9(_0x48a739['value']):_0x44739f(_0x48a739['value'])['then'](_0xb67ce1,_0x470c12);}_0x501dd6((_0xdeeb29=_0xdeeb29['apply'](_0x40ca37,_0x7752e3||[]))['next']());});};class ListService{constructor(_0x284e5b,_0x3d550a){this['baseUri']=_0x284e5b,this['tokenManager']=_0x3d550a;}['add'](_0x3c6793,_0x5ccdb5,_0x5a2901){return __awaiter$2(this,arguments,void 0,function*(_0x2a9d00,_0x15dbcb,_0x808a28,_0x4852eb={}){var _0x55fea3;const _0x58b67e=yield this['tokenManager']['getTokens'](_0x808a28,_0x4852eb);if(!_0x58b67e['isSuccess'])return new FailedAccountResponse(_0x58b67e['toProblem']());_0x808a28=_0x58b67e['toSuccess']();let _0x290500=(_0x55fea3=_0x4852eb['baseUri'])!==null&&_0x55fea3!==void 0?_0x55fea3:this['baseUri'];!_0x290500['endsWith']('/')&&(_0x290500=_0x290500+'/');_0x290500=_0x290500+'List';const _0x368a66={'account_name':_0x2a9d00,'list_name':_0x15dbcb};try{const _0x278aeb=yield Fetch['post'](_0x290500,_0x808a28['access_token'],_0x368a66);if(_0x278aeb['status']>0xc7&&_0x278aeb['status']<0x12c){const _0x47b0db=yield _0x278aeb['json']();return new SuccessfulAccountResponse(_0x47b0db);}const _0xb09391=yield _0x278aeb['json']();return new FailedAccountResponse(_0xb09391);}catch(_0x678a47){if(_0x678a47 instanceof Error)return new FailedAccountResponse({'detail':_0x678a47['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x678a47;}});}['remove'](_0x182ea5,_0x327e10,_0xd2c5ee){return __awaiter$2(this,arguments,void 0,function*(_0x4a7435,_0x399a14,_0x476205,_0x1c3548={}){var _0x3244de;const _0x2c628a=yield this['tokenManager']['getTokens'](_0x476205,_0x1c3548);if(!_0x2c628a['isSuccess'])return new FailedAccountResponse(_0x2c628a['toProblem']());_0x476205=_0x2c628a['toSuccess']();let _0x553de9=(_0x3244de=_0x1c3548['baseUri'])!==null&&_0x3244de!==void 0?_0x3244de:this['baseUri'];_0x553de9=_0x553de9+'/List/'+_0x4a7435+'/'+_0x399a14;const _0x452c2b=yield Fetch['delete'](_0x553de9,_0x476205['access_token']);try{if(_0x452c2b['status']>0xc7&&_0x452c2b['status']<0x12c){const _0xc149e1=yield _0x452c2b['json']();return new SuccessfulAccountResponse(_0xc149e1);}const _0x8e682f=yield _0x452c2b['json']();return new FailedAccountResponse(_0x8e682f);}catch(_0x1b3187){if(_0x1b3187 instanceof Error)return new FailedAccountResponse({'detail':_0x1b3187['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1b3187;}});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x40628e,_0x238e5b,_0x175b2c,_0x3930b9){function _0x640619(_0x149449){return _0x149449 instanceof _0x175b2c?_0x149449:new _0x175b2c(function(_0x5d14e6){_0x5d14e6(_0x149449);});}return new(_0x175b2c||(_0x175b2c=Promise))(function(_0xb65450,_0x3172b9){function _0x45b1c1(_0xfbfe0a){try{_0x3960d9(_0x3930b9['next'](_0xfbfe0a));}catch(_0x265388){_0x3172b9(_0x265388);}}function _0x16de14(_0x6e7dca){try{_0x3960d9(_0x3930b9['throw'](_0x6e7dca));}catch(_0x1315d2){_0x3172b9(_0x1315d2);}}function _0x3960d9(_0x5a3c30){_0x5a3c30['done']?_0xb65450(_0x5a3c30['value']):_0x640619(_0x5a3c30['value'])['then'](_0x45b1c1,_0x16de14);}_0x3960d9((_0x3930b9=_0x3930b9['apply'](_0x40628e,_0x238e5b||[]))['next']());});};class ApiKeyService{constructor(_0x1849a1,_0x5de876){this['tokenManager']=_0x1849a1,this['fetch']=_0x5de876;}['create'](_0x2367a1,_0x475fa9,_0xb02ed3){return __awaiter$2(this,void 0,void 0,function*(){const _0x3fb7aa=yield this['tokenManager']['getOrRefreshTokens'](_0xb02ed3);if(!_0x3fb7aa['isSuccess'])return new FailedApiKeyResponse(_0x3fb7aa['toProblem']());_0xb02ed3=_0x3fb7aa['toSuccess']();const _0x449c9d='ApiKey/Create',_0x352b44={'account_name':_0x2367a1,'name':_0x475fa9};try{const _0x39b701=yield this['fetch']['post'](_0x449c9d,_0xb02ed3['access_token'],_0x352b44);if(_0x39b701['status']>0xc7&&_0x39b701['status']<0x12c){const _0x4cd14a=yield _0x39b701['json']();return new SuccessfulApiKeyResponse(_0x4cd14a);}const _0x13a717=yield _0x39b701['json']();return new FailedApiKeyResponse(_0x13a717);}catch(_0x5dec1b){if(_0x5dec1b instanceof Error)return new FailedApiKeyResponse({'detail':_0x5dec1b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5dec1b;}});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5baa7b,_0xd4b1ec,_0x500777,_0x7124ed){function _0x2dd082(_0x12c7ec){return _0x12c7ec instanceof _0x500777?_0x12c7ec:new _0x500777(function(_0x499e18){_0x499e18(_0x12c7ec);});}return new(_0x500777||(_0x500777=Promise))(function(_0x4e8e38,_0x447e8b){function _0x9387ea(_0x230e7c){try{_0x556412(_0x7124ed['next'](_0x230e7c));}catch(_0x5b0826){_0x447e8b(_0x5b0826);}}function _0x43c289(_0x5095a4){try{_0x556412(_0x7124ed['throw'](_0x5095a4));}catch(_0x4bf36d){_0x447e8b(_0x4bf36d);}}function _0x556412(_0x28893b){_0x28893b['done']?_0x4e8e38(_0x28893b['value']):_0x2dd082(_0x28893b['value'])['then'](_0x9387ea,_0x43c289);}_0x556412((_0x7124ed=_0x7124ed['apply'](_0x5baa7b,_0xd4b1ec||[]))['next']());});};class TokenManager{constructor(_0x223233){this['tokenService']=_0x223233,this['getTokens']=(_0x3ec303,..._0x45cf19)=>__awaiter$1(this,[_0x3ec303,..._0x45cf19],void 0,function*(_0x598364,_0x4e5f14={}){if(_0x598364){var _0x24303e=yield this['refreshIfExpired'](_0x598364,_0x4e5f14);if(_0x24303e['isSuccess'])return _0x24303e;}return yield this['tokenService']['get'](_0x4e5f14);});}['refreshIfExpired'](_0x308968){return __awaiter$1(this,arguments,void 0,function*(_0x4d942e,_0x15f707={}){if(Date['now']()<_0x4d942e['access_expires'])return new SuccessfulRefreshResponse(_0x4d942e);if(Date['now']()>_0x4d942e['refresh_expires']){const _0x2bf63b={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x2bf63b);}return yield this['tokenService']['refresh'](_0x4d942e['refresh_token'],_0x15f707);});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5954ab,_0x414fb6,_0x236374,_0x583c20){function _0x4ca750(_0x82a613){return _0x82a613 instanceof _0x236374?_0x82a613:new _0x236374(function(_0x399dff){_0x399dff(_0x82a613);});}return new(_0x236374||(_0x236374=Promise))(function(_0x443af2,_0x266e44){function _0x545ec8(_0x360b6f){try{_0xe20669(_0x583c20['next'](_0x360b6f));}catch(_0x2fc2aa){_0x266e44(_0x2fc2aa);}}function _0xe3b363(_0x180e7c){try{_0xe20669(_0x583c20['throw'](_0x180e7c));}catch(_0x5f15f5){_0x266e44(_0x5f15f5);}}function _0xe20669(_0x362e47){_0x362e47['done']?_0x443af2(_0x362e47['value']):_0x4ca750(_0x362e47['value'])['then'](_0x545ec8,_0xe3b363);}_0xe20669((_0x583c20=_0x583c20['apply'](_0x5954ab,_0x414fb6||[]))['next']());});};class ListService{constructor(_0x420fdc,_0x24091f){this['tokenManager']=_0x420fdc,this['fetch']=_0x24091f;}['add'](_0x5e6fed,_0xe4bf54,_0xd3f1d5){return __awaiter$1(this,void 0,void 0,function*(){const _0x776dda=yield this['tokenManager']['getOrRefreshTokens'](_0xd3f1d5);if(!_0x776dda['isSuccess'])return new FailedAccountResponse(_0x776dda['toProblem']());_0xd3f1d5=_0x776dda['toSuccess']();const _0x20150f='List',_0x5a3485={'account_name':_0x5e6fed,'list_name':_0xe4bf54};try{const _0x201402=yield this['fetch']['post'](_0x20150f,_0xd3f1d5['access_token'],_0x5a3485);if(_0x201402['status']>0xc7&&_0x201402['status']<0x12c){const _0xe4491f=yield _0x201402['json']();return new SuccessfulAccountResponse(_0xe4491f);}const _0x41be58=yield _0x201402['json']();return new FailedAccountResponse(_0x41be58);}catch(_0x2e7784){if(_0x2e7784 instanceof Error)return new FailedAccountResponse({'detail':_0x2e7784['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2e7784;}});}['remove'](_0x54c0ed,_0x1d3df4,_0x4a03fa){return __awaiter$1(this,void 0,void 0,function*(){const _0xd6ab0d=yield this['tokenManager']['getOrRefreshTokens'](_0x4a03fa);if(!_0xd6ab0d['isSuccess'])return new FailedAccountResponse(_0xd6ab0d['toProblem']());_0x4a03fa=_0xd6ab0d['toSuccess']();const _0x58b446='List/'+_0x54c0ed+'/'+_0x1d3df4,_0x1f26a0=yield this['fetch']['delete'](_0x58b446,_0x4a03fa['access_token']);try{if(_0x1f26a0['status']>0xc7&&_0x1f26a0['status']<0x12c){const _0x4f8b44=yield _0x1f26a0['json']();return new SuccessfulAccountResponse(_0x4f8b44);}const _0x1d37a7=yield _0x1f26a0['json']();return new FailedAccountResponse(_0x1d37a7);}catch(_0x44deff){if(_0x44deff instanceof Error)return new FailedAccountResponse({'detail':_0x44deff['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x44deff;}});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x284d10,_0x1ca35c,_0x299246,_0x654a17){function _0x1193e4(_0x533e55){return _0x533e55 instanceof _0x299246?_0x533e55:new _0x299246(function(_0x20e79c){_0x20e79c(_0x533e55);});}return new(_0x299246||(_0x299246=Promise))(function(_0xce43cb,_0x42c676){function _0x284b7e(_0x141d8c){try{_0x5176b1(_0x654a17['next'](_0x141d8c));}catch(_0x105dfb){_0x42c676(_0x105dfb);}}function _0x13ae14(_0x8eb17){try{_0x5176b1(_0x654a17['throw'](_0x8eb17));}catch(_0x218802){_0x42c676(_0x218802);}}function _0x5176b1(_0x5ba879){_0x5ba879['done']?_0xce43cb(_0x5ba879['value']):_0x1193e4(_0x5ba879['value'])['then'](_0x284b7e,_0x13ae14);}_0x5176b1((_0x654a17=_0x654a17['apply'](_0x284d10,_0x1ca35c||[]))['next']());});};class TokenService{constructor(_0x4c435a,_0x48c746){this['apiKey']=_0x4c435a,this['baseUri']=_0x48c746;}['get'](){return __awaiter(this,arguments,void 0,function*(_0x79bac7={}){var _0x1659cc;if(!this['apiKey'])return new FailedRefreshResponse({'detail':'API\x20Key\x20required.','title':'','status':0x193,'instance':'','type':''});let _0x421fa5=(_0x1659cc=_0x79bac7['baseUri'])!==null&&_0x1659cc!==void 0?_0x1659cc:this['baseUri'];!_0x421fa5['endsWith']('/')&&(_0x421fa5=_0x421fa5+'/');_0x421fa5=_0x421fa5+'tokens/get/'+this['apiKey'];try{const _0x5013f5=yield yield fetch(_0x421fa5,{'method':'POST','headers':{'Content-Type':'application/json'}});if(_0x5013f5['status']>0xc7&&_0x5013f5['status']<0x12c){const _0xa763bb=yield _0x5013f5['json']();return new SuccessfulRefreshResponse(_0xa763bb);}const _0x123ddc=yield _0x5013f5['json']();return new FailedRefreshResponse(_0x123ddc);}catch(_0x4b812e){if(_0x4b812e instanceof Error)return new FailedRefreshResponse({'detail':_0x4b812e['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4b812e;}});}['refresh'](_0x1cb142){return __awaiter(this,arguments,void 0,function*(_0x5f1be8,_0x3b4a1c={}){var _0x1d3590;let _0x2fd94d=(_0x1d3590=_0x3b4a1c['baseUri'])!==null&&_0x1d3590!==void 0?_0x1d3590:this['baseUri'];!_0x2fd94d['endsWith']('/')&&(_0x2fd94d=_0x2fd94d+'/');_0x2fd94d=_0x2fd94d+'Tokens/Refresh';try{const _0x3db9db=yield Fetch['post'](_0x2fd94d,_0x5f1be8,null);if(_0x3db9db['status']>0xc7&&_0x3db9db['status']<0x12c){const _0xbfdec6=yield _0x3db9db['json']();return new SuccessfulRefreshResponse(_0xbfdec6);}const _0x566c01=yield _0x3db9db['json']();return new FailedRefreshResponse(_0x566c01);}catch(_0x15a4c5){if(_0x15a4c5 instanceof Error)return new FailedRefreshResponse({'detail':_0x15a4c5['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x15a4c5;}});}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x13ef89,_0x507cd7,_0x50c0b6,_0x105c20){function _0x3aed88(_0x1f0de9){return _0x1f0de9 instanceof _0x50c0b6?_0x1f0de9:new _0x50c0b6(function(_0x18a446){_0x18a446(_0x1f0de9);});}return new(_0x50c0b6||(_0x50c0b6=Promise))(function(_0x264b48,_0x54c701){function _0x1088f6(_0x49f4d6){try{_0x33aac2(_0x105c20['next'](_0x49f4d6));}catch(_0x3753d3){_0x54c701(_0x3753d3);}}function _0x4095d6(_0x129f91){try{_0x33aac2(_0x105c20['throw'](_0x129f91));}catch(_0x338921){_0x54c701(_0x338921);}}function _0x33aac2(_0x3e2e5e){_0x3e2e5e['done']?_0x264b48(_0x3e2e5e['value']):_0x3aed88(_0x3e2e5e['value'])['then'](_0x1088f6,_0x4095d6);}_0x33aac2((_0x105c20=_0x105c20['apply'](_0x13ef89,_0x507cd7||[]))['next']());});};class TokenManager{constructor(_0x50d0d7){this['authClient']=_0x50d0d7;}['getOrRefreshTokens'](_0x4327e5){return __awaiter(this,void 0,void 0,function*(){if(!_0x4327e5)return this['authClient']['login']();if(Date['now']()<_0x4327e5['access_expires'])return new SuccessfulAuthResponse(_0x4327e5);if(Date['now']()>_0x4327e5['refresh_expires'])return yield this['authClient']['refresh'](_0x4327e5['refresh_token']);return this['authClient']['login']();});}}
14
14
 
15
- class AdminClient{constructor(_0x9f6290,_0x3b435a='https://admin.searchability.dev/'){this['apiKey']=_0x9f6290,this['baseUri']=_0x3b435a,this['Tokens']=new TokenService(_0x9f6290,this['baseUri']);const _0x372c82=new TokenManager(this['Tokens']);this['Accounts']=new AccountService(this['baseUri'],_0x372c82),this['Lists']=new ListService(this['baseUri'],_0x372c82),this['ApiKeys']=new ApiKeyService(this['baseUri'],_0x372c82);}}
15
+ class AdminClient{constructor(_0x5bc243,_0x238952='https://admin.searchability.dev/'){var _0x4fd609=new TokenManager(_0x5bc243),_0x275619=new Fetch(_0x238952);this['Accounts']=new AccountService(_0x4fd609,_0x275619),this['Lists']=new ListService(_0x4fd609,_0x275619),this['ApiKeys']=new ApiKeyService(_0x4fd609,_0x275619);}}
16
16
 
17
- export { AdminClient };
17
+ export { AdminClient as default };
package/dist/types.d.ts CHANGED
@@ -1,53 +1,56 @@
1
- declare class TokenService {
2
- readonly apiKey: string | undefined;
1
+ declare class Fetch {
3
2
  readonly baseUri: string;
4
- constructor(apiKey: string | undefined, baseUri: string);
5
- get(options?: Partial<Options>): Promise<Response<Tokens, Problem>>;
6
- refresh(refreshToken: string, options?: Partial<Options>): Promise<Response<Tokens, Problem>>;
3
+ constructor(baseUri: string);
4
+ private getUrl;
5
+ get(path: string, accessToken: string): Promise<globalThis.Response>;
6
+ post(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
7
+ put(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
8
+ delete(path: string, accessToken: string): Promise<globalThis.Response>;
9
+ }
10
+
11
+ declare class AuthClient {
12
+ readonly apiKey: string;
13
+ readonly fetch: Fetch;
14
+ constructor(apiKey: string, baseUri?: string);
15
+ login(): Promise<Response<Tokens, Problem>>;
16
+ refresh(refreshToken: string): Promise<Response<Tokens, Problem>>;
7
17
  }
8
18
 
9
19
  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;
20
+ readonly authClient: AuthClient;
21
+ constructor(authClient: AuthClient);
22
+ getOrRefreshTokens(tokens: Tokens | undefined): Promise<Response<Tokens, Problem>>;
14
23
  }
15
24
 
16
25
  declare class AccountService {
17
- readonly baseUri: string;
18
26
  readonly tokenManager: TokenManager;
19
- constructor(baseUri: string, tokenManager: TokenManager);
20
- get(accountName: string, tokens?: Tokens | undefined, options?: Partial<Options>): Promise<Response<Account, Problem>>;
27
+ readonly fetch: Fetch;
28
+ constructor(tokenManager: TokenManager, fetch: Fetch);
29
+ get(accountName: string, tokens?: Tokens | undefined): Promise<Response<Account, Problem>>;
21
30
  }
22
31
 
23
32
  declare class ApiKeyService {
24
- readonly baseUri: string;
25
33
  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>>;
34
+ readonly fetch: Fetch;
35
+ constructor(tokenManager: TokenManager, fetch: Fetch);
36
+ create(accountName: string, apiKeyName: string, tokens: Tokens | undefined): Promise<Response<ApiKey, Problem>>;
28
37
  }
29
38
 
30
39
  declare class ListService {
31
- readonly baseUri: string;
32
40
  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>>;
41
+ readonly fetch: Fetch;
42
+ constructor(tokenManager: TokenManager, fetch: Fetch);
43
+ add(accountName: string, listName: string, tokens: Tokens | undefined): Promise<Response<Account, Problem>>;
44
+ remove(accountName: string, listName: string, tokens: Tokens | undefined): Promise<Response<Account, Problem>>;
36
45
  }
37
46
 
38
47
  declare class AdminClient {
39
- readonly apiKey: string | undefined;
40
- readonly baseUri: string;
41
- constructor(apiKey: string | undefined, baseUri?: string);
42
- readonly Tokens: TokenService;
48
+ constructor(authClient: AuthClient, baseUri?: string);
43
49
  readonly Accounts: AccountService;
44
50
  readonly Lists: ListService;
45
51
  readonly ApiKeys: ApiKeyService;
46
52
  }
47
53
 
48
- type Options = {
49
- baseUri?: string;
50
- };
51
54
  declare abstract class Response<S, F> {
52
55
  readonly isSuccess: boolean;
53
56
  constructor(isSuccess: boolean);
@@ -105,13 +108,13 @@ declare class FailedAccountResponse extends Response<Account, Problem> {
105
108
  toSuccess(): Account;
106
109
  toProblem(): Problem;
107
110
  }
108
- declare class SuccessfulRefreshResponse extends Response<Tokens, Problem> {
111
+ declare class SuccessfulAuthResponse extends Response<Tokens, Problem> {
109
112
  readonly tokens: Tokens;
110
113
  constructor(tokens: Tokens);
111
114
  toSuccess(): Tokens;
112
115
  toProblem(): Problem;
113
116
  }
114
- declare class FailedRefreshResponse extends Response<Tokens, Problem> {
117
+ declare class FailedAuthResponse extends Response<Tokens, Problem> {
115
118
  readonly problem: Problem;
116
119
  constructor(problem: Problem);
117
120
  toSuccess(): Tokens;
@@ -130,4 +133,4 @@ declare class FailedApiKeyResponse extends Response<ApiKey, Problem> {
130
133
  toProblem(): Problem;
131
134
  }
132
135
 
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 };
136
+ export { type Account, AdminClient, type ApiKey, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, type Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",