@searchability/admin-client 0.0.4 → 0.0.5
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$4=undefined&&undefined['__awaiter']||function(_0x22b0dc,_0x15a21f,_0x3815e9,_0x5162bb){function _0x122c0f(_0x3016a0){return _0x3016a0 instanceof _0x3815e9?_0x3016a0:new _0x3815e9(function(_0x36a031){_0x36a031(_0x3016a0);});}return new(_0x3815e9||(_0x3815e9=Promise))(function(_0xdc914b,_0x27f9f1){function _0x4de182(_0x466639){try{_0x2d44da(_0x5162bb['next'](_0x466639));}catch(_0x513151){_0x27f9f1(_0x513151);}}function _0x5359b2(_0x3d06d5){try{_0x2d44da(_0x5162bb['throw'](_0x3d06d5));}catch(_0x5c777b){_0x27f9f1(_0x5c777b);}}function _0x2d44da(_0x229fd4){_0x229fd4['done']?_0xdc914b(_0x229fd4['value']):_0x122c0f(_0x229fd4['value'])['then'](_0x4de182,_0x5359b2);}_0x2d44da((_0x5162bb=_0x5162bb['apply'](_0x22b0dc,_0x15a21f||[]))['next']());});};class Fetch{static['get'](_0x47a65d,_0x153fb0){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x47a65d,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x153fb0}});});}static['post'](_0x1e5e17,_0x2c85b9,_0x281891){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1e5e17,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2c85b9},'body':_0x281891?JSON['stringify'](_0x281891):null});});}static['put'](_0x474ca6,_0x35a23c,_0x6d0dcc){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x474ca6,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x35a23c},'body':_0x6d0dcc?JSON['stringify'](_0x6d0dcc):null});});}static['delete'](_0x3b1d88,_0x861282){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3b1d88,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x861282}});});}}
|
|
2
|
+
|
|
3
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x20ff07,_0xb6283b,_0x1879ef,_0x3e6d96){function _0x1121ef(_0x4049f8){return _0x4049f8 instanceof _0x1879ef?_0x4049f8:new _0x1879ef(function(_0x3d294d){_0x3d294d(_0x4049f8);});}return new(_0x1879ef||(_0x1879ef=Promise))(function(_0x23b194,_0x17d1f8){function _0x25da45(_0x231329){try{_0x381188(_0x3e6d96['next'](_0x231329));}catch(_0x33a66b){_0x17d1f8(_0x33a66b);}}function _0x4fa7b6(_0xe33269){try{_0x381188(_0x3e6d96['throw'](_0xe33269));}catch(_0x1bfdca){_0x17d1f8(_0x1bfdca);}}function _0x381188(_0x2808fc){_0x2808fc['done']?_0x23b194(_0x2808fc['value']):_0x1121ef(_0x2808fc['value'])['then'](_0x25da45,_0x4fa7b6);}_0x381188((_0x3e6d96=_0x3e6d96['apply'](_0x20ff07,_0xb6283b||[]))['next']());});};class ListService{constructor(_0x42ae8c){this['baseUri']=_0x42ae8c;}['add'](_0x3b5268,_0x32ee5f,_0x46ce86){return __awaiter$3(this,arguments,void 0,function*(_0x19e76e,_0x588bc2,_0x5fc274,_0x402aa7={}){var _0x12ce8a;let _0x3c9a30=(_0x12ce8a=_0x402aa7['baseUri'])!==null&&_0x12ce8a!==void 0?_0x12ce8a:this['baseUri'];!_0x3c9a30['endsWith']('/')&&(_0x3c9a30=_0x3c9a30+'/');_0x3c9a30=_0x3c9a30+'List';const _0x2814a1={'account_name':_0x588bc2,'list_name':_0x5fc274},_0x48e17e=yield Fetch['post'](_0x3c9a30,_0x19e76e,_0x2814a1);if(_0x48e17e['status']>0xc7&&_0x48e17e['status']<0x12c){const _0x4b6bf6=yield _0x48e17e['json']();return new SuccessfulAccountResponse(_0x4b6bf6);}if(_0x48e17e['bodyUsed']){const _0x182f98=yield _0x48e17e['json']();return new FailedAccountResponse(_0x182f98);}const _0x2eab11={'type':'','status':_0x48e17e['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x2eab11);});}['remove'](_0x315206,_0x50f029,_0x55c0cb){return __awaiter$3(this,arguments,void 0,function*(_0x4091b1,_0x40d4ba,_0x233e3e,_0xf22e10={}){var _0x223b9a;let _0x299f26=(_0x223b9a=_0xf22e10['baseUri'])!==null&&_0x223b9a!==void 0?_0x223b9a:this['baseUri'];_0x299f26=_0x299f26+'/List/'+_0x40d4ba+'/'+_0x233e3e;const _0x10b202=yield Fetch['delete'](_0x299f26,_0x4091b1);if(_0x10b202['status']>0xc7&&_0x10b202['status']<0x12c){const _0x6d39eb=yield _0x10b202['json']();return new SuccessfulAccountResponse(_0x6d39eb);}if(_0x10b202['bodyUsed']){const _0x51b6d8=yield _0x10b202['json']();return new FailedAccountResponse(_0x51b6d8);}const _0x29f228={'type':'','status':_0x10b202['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x29f228);});}}
|
|
4
|
+
|
|
5
|
+
class Response{constructor(_0x133e47){this['isSuccess']=_0x133e47;}}class SuccessfulAccountResponse extends Response{constructor(_0x27d2e8){super(!![]),this['account']=_0x27d2e8;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x32f2f9){super(![]),this['problem']=_0x32f2f9;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x2460f1){super(!![]),this['tokens']=_0x2460f1;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x2f2be6){super(![]),this['problem']=_0x2f2be6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
6
|
+
|
|
7
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x3355da,_0x436357,_0x2e9e98,_0x218c90){function _0x416807(_0x4b96f0){return _0x4b96f0 instanceof _0x2e9e98?_0x4b96f0:new _0x2e9e98(function(_0x1c9abd){_0x1c9abd(_0x4b96f0);});}return new(_0x2e9e98||(_0x2e9e98=Promise))(function(_0x35ee5c,_0x462aeb){function _0x3dc267(_0x4ea50e){try{_0xa1de2e(_0x218c90['next'](_0x4ea50e));}catch(_0x380b3b){_0x462aeb(_0x380b3b);}}function _0x39f5b7(_0x52f629){try{_0xa1de2e(_0x218c90['throw'](_0x52f629));}catch(_0x1543b6){_0x462aeb(_0x1543b6);}}function _0xa1de2e(_0x4c0ea8){_0x4c0ea8['done']?_0x35ee5c(_0x4c0ea8['value']):_0x416807(_0x4c0ea8['value'])['then'](_0x3dc267,_0x39f5b7);}_0xa1de2e((_0x218c90=_0x218c90['apply'](_0x3355da,_0x436357||[]))['next']());});};class AccountService{constructor(_0x4c03d4){this['baseUri']=_0x4c03d4;}['get'](_0x2cd554,_0x32bb9){return __awaiter$2(this,arguments,void 0,function*(_0x528add,_0x279872,_0x294b81={}){var _0x8eca0b;let _0x121c1b=(_0x8eca0b=_0x294b81['baseUri'])!==null&&_0x8eca0b!==void 0?_0x8eca0b:this['baseUri'];!_0x121c1b['endsWith']('/')&&(_0x121c1b=_0x121c1b+'/');_0x121c1b=_0x121c1b+'Account/'+_0x279872+'/';const _0x14e6a8=yield Fetch['get'](_0x121c1b,_0x528add);if(_0x14e6a8['status']>0xc7&&_0x14e6a8['status']<0x12c){const _0xb09ca4=yield _0x14e6a8['json']();return new SuccessfulAccountResponse(_0xb09ca4);}if(_0x14e6a8['bodyUsed']){const _0x87284b=yield _0x14e6a8['json']();return new FailedAccountResponse(_0x87284b);}const _0x9e48c9={'type':'','status':_0x14e6a8['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x9e48c9);});}}
|
|
8
|
+
|
|
9
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x53ab04,_0xe5ec75,_0x21937b,_0x226926){function _0x258cd2(_0x633c02){return _0x633c02 instanceof _0x21937b?_0x633c02:new _0x21937b(function(_0x50eb27){_0x50eb27(_0x633c02);});}return new(_0x21937b||(_0x21937b=Promise))(function(_0x129920,_0x2810c6){function _0x8a8e60(_0x4de5f9){try{_0x422057(_0x226926['next'](_0x4de5f9));}catch(_0x1fdef7){_0x2810c6(_0x1fdef7);}}function _0xba6b32(_0x56028c){try{_0x422057(_0x226926['throw'](_0x56028c));}catch(_0x48e0aa){_0x2810c6(_0x48e0aa);}}function _0x422057(_0x567dfc){_0x567dfc['done']?_0x129920(_0x567dfc['value']):_0x258cd2(_0x567dfc['value'])['then'](_0x8a8e60,_0xba6b32);}_0x422057((_0x226926=_0x226926['apply'](_0x53ab04,_0xe5ec75||[]))['next']());});};class TokenManager{constructor(_0x404272){this['securityService']=_0x404272;}['RefreshTokens'](_0x5591de){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x5591de['access_expires'])return new SuccessfulRefreshResponse(_0x5591de);if(Date['now']()>_0x5591de['refresh_expires']){const _0x26e588={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x26e588);}const _0x283b50=yield this['securityService']['refresh'](_0x5591de['refresh_token']);if(!_0x283b50['isSuccess'])return new FailedRefreshResponse(_0x283b50['toProblem']());return new SuccessfulRefreshResponse(_0x283b50['toSuccess']());});}}
|
|
10
|
+
|
|
11
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x552c69,_0x51f5bb,_0x280868,_0xc280f6){function _0x76c13d(_0x3389e8){return _0x3389e8 instanceof _0x280868?_0x3389e8:new _0x280868(function(_0x3bd60b){_0x3bd60b(_0x3389e8);});}return new(_0x280868||(_0x280868=Promise))(function(_0xe93b9d,_0x3626f7){function _0x17ffbf(_0x866605){try{_0x2191e5(_0xc280f6['next'](_0x866605));}catch(_0x37b84c){_0x3626f7(_0x37b84c);}}function _0x293675(_0x284036){try{_0x2191e5(_0xc280f6['throw'](_0x284036));}catch(_0x47bdb9){_0x3626f7(_0x47bdb9);}}function _0x2191e5(_0x22c695){_0x22c695['done']?_0xe93b9d(_0x22c695['value']):_0x76c13d(_0x22c695['value'])['then'](_0x17ffbf,_0x293675);}_0x2191e5((_0xc280f6=_0xc280f6['apply'](_0x552c69,_0x51f5bb||[]))['next']());});};class SecurityService{constructor(_0x15df19){this['baseUri']=_0x15df19,this['tokenManager']=new TokenManager(this);}['refresh'](_0x50cf56){return __awaiter(this,arguments,void 0,function*(_0x366ad3,_0x1fcd71={}){var _0x210760;let _0x3ddef4=(_0x210760=_0x1fcd71['baseUri'])!==null&&_0x210760!==void 0?_0x210760:this['baseUri'];!_0x3ddef4['endsWith']('/')&&(_0x3ddef4=_0x3ddef4+'/');_0x3ddef4=_0x3ddef4+'Security/Refresh';const _0x5b11de=yield Fetch['post'](_0x3ddef4,_0x366ad3,null);if(_0x5b11de['status']>0xc7&&_0x5b11de['status']<0x12c){const _0x4203de=yield _0x5b11de['json']();return new SuccessfulRefreshResponse(_0x4203de);}if(_0x5b11de['bodyUsed']){const _0x4e3a8c=yield _0x5b11de['json']();return new FailedRefreshResponse(_0x4e3a8c);}const _0x384aa8={'type':'','status':_0x5b11de['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x384aa8);});}}
|
|
12
|
+
|
|
13
|
+
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
14
|
+
|
|
15
|
+
export { AdminClient };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
3
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x26b976,_0x577e97,_0x35d480,_0x5af5cd){function _0x5d30ee(_0x1a4d8c){return _0x1a4d8c instanceof _0x35d480?_0x1a4d8c:new _0x35d480(function(_0x263ebb){_0x263ebb(_0x1a4d8c);});}return new(_0x35d480||(_0x35d480=Promise))(function(_0x19162b,_0x1cba5f){function _0x5c231b(_0x3d9ac8){try{_0x33cfd6(_0x5af5cd['next'](_0x3d9ac8));}catch(_0x431267){_0x1cba5f(_0x431267);}}function _0x168fa4(_0x16ee42){try{_0x33cfd6(_0x5af5cd['throw'](_0x16ee42));}catch(_0x3a13d5){_0x1cba5f(_0x3a13d5);}}function _0x33cfd6(_0x2c237d){_0x2c237d['done']?_0x19162b(_0x2c237d['value']):_0x5d30ee(_0x2c237d['value'])['then'](_0x5c231b,_0x168fa4);}_0x33cfd6((_0x5af5cd=_0x5af5cd['apply'](_0x26b976,_0x577e97||[]))['next']());});};class Fetch{static['get'](_0x3d8e75,_0x659a29){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3d8e75,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x659a29}});});}static['post'](_0x3b4764,_0x3a7c9f,_0x2aa780){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3b4764,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3a7c9f},'body':_0x2aa780?JSON['stringify'](_0x2aa780):null});});}static['put'](_0x2087d5,_0x245dd2,_0x5f0a3c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x2087d5,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x245dd2},'body':_0x5f0a3c?JSON['stringify'](_0x5f0a3c):null});});}static['delete'](_0x2a4803,_0x5015c9){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x2a4803,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5015c9}});});}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x5eaedc,_0x56235f,_0x265705,_0x4c3a90){function _0x2c131d(_0x3a91dc){return _0x3a91dc instanceof _0x265705?_0x3a91dc:new _0x265705(function(_0x1f6310){_0x1f6310(_0x3a91dc);});}return new(_0x265705||(_0x265705=Promise))(function(_0x446579,_0x167736){function _0x5ec3d7(_0x31bbb3){try{_0x32e177(_0x4c3a90['next'](_0x31bbb3));}catch(_0xf7d576){_0x167736(_0xf7d576);}}function _0x37e5f9(_0x17544c){try{_0x32e177(_0x4c3a90['throw'](_0x17544c));}catch(_0x51bc2b){_0x167736(_0x51bc2b);}}function _0x32e177(_0x1a0096){_0x1a0096['done']?_0x446579(_0x1a0096['value']):_0x2c131d(_0x1a0096['value'])['then'](_0x5ec3d7,_0x37e5f9);}_0x32e177((_0x4c3a90=_0x4c3a90['apply'](_0x5eaedc,_0x56235f||[]))['next']());});};class ListService{constructor(_0x4d5fdb){this['baseUri']=_0x4d5fdb;}['add'](_0x26063d,_0xccb08a,_0x232908){return __awaiter$3(this,arguments,void 0,function*(_0x2073fb,_0x56180a,_0x518613,_0xc01af4={}){var _0x1cbba6;let _0x4ba248=(_0x1cbba6=_0xc01af4['baseUri'])!==null&&_0x1cbba6!==void 0?_0x1cbba6:this['baseUri'];!_0x4ba248['endsWith']('/')&&(_0x4ba248=_0x4ba248+'/');_0x4ba248=_0x4ba248+'List';const _0x1db539={'account_name':_0x56180a,'list_name':_0x518613},_0x1ea6e9=yield Fetch['post'](_0x4ba248,_0x2073fb,_0x1db539);if(_0x1ea6e9['status']>0xc7&&_0x1ea6e9['status']<0x12c){const _0x40e074=yield _0x1ea6e9['json']();return new SuccessfulAccountResponse(_0x40e074);}if(_0x1ea6e9['bodyUsed']){const _0x4978e1=yield _0x1ea6e9['json']();return new FailedAccountResponse(_0x4978e1);}const _0x5d17be={'type':'','status':_0x1ea6e9['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5d17be);});}['remove'](_0x17d7a9,_0x150710,_0x36c60e){return __awaiter$3(this,arguments,void 0,function*(_0x212e05,_0x18c537,_0x5b682c,_0x556be9={}){var _0x5e349a;let _0x5a433c=(_0x5e349a=_0x556be9['baseUri'])!==null&&_0x5e349a!==void 0?_0x5e349a:this['baseUri'];_0x5a433c=_0x5a433c+'/List/'+_0x18c537+'/'+_0x5b682c;const _0x3e6770=yield Fetch['delete'](_0x5a433c,_0x212e05);if(_0x3e6770['status']>0xc7&&_0x3e6770['status']<0x12c){const _0x5022f9=yield _0x3e6770['json']();return new SuccessfulAccountResponse(_0x5022f9);}if(_0x3e6770['bodyUsed']){const _0x2b44f7=yield _0x3e6770['json']();return new FailedAccountResponse(_0x2b44f7);}const _0x107bef={'type':'','status':_0x3e6770['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x107bef);});}}
|
|
6
6
|
|
|
7
|
-
class Response{constructor(
|
|
7
|
+
class Response{constructor(_0x1432e5){this['isSuccess']=_0x1432e5;}}class SuccessfulAccountResponse extends Response{constructor(_0x449d65){super(!![]),this['account']=_0x449d65;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2b5065){super(![]),this['problem']=_0x2b5065;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x3286c2){super(!![]),this['tokens']=_0x3286c2;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x341ae3){super(![]),this['problem']=_0x341ae3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x1c0d47,_0x4b366c,_0x33ca5,_0x8f3279){function _0x5396a9(_0x3c7be7){return _0x3c7be7 instanceof _0x33ca5?_0x3c7be7:new _0x33ca5(function(_0x3782e0){_0x3782e0(_0x3c7be7);});}return new(_0x33ca5||(_0x33ca5=Promise))(function(_0x24ed25,_0x489e7e){function _0x214b93(_0x14db67){try{_0x47bb4f(_0x8f3279['next'](_0x14db67));}catch(_0x4e8447){_0x489e7e(_0x4e8447);}}function _0x3c0936(_0x313a40){try{_0x47bb4f(_0x8f3279['throw'](_0x313a40));}catch(_0x4accdd){_0x489e7e(_0x4accdd);}}function _0x47bb4f(_0x2e1bf8){_0x2e1bf8['done']?_0x24ed25(_0x2e1bf8['value']):_0x5396a9(_0x2e1bf8['value'])['then'](_0x214b93,_0x3c0936);}_0x47bb4f((_0x8f3279=_0x8f3279['apply'](_0x1c0d47,_0x4b366c||[]))['next']());});};class AccountService{constructor(_0x1295e6){this['baseUri']=_0x1295e6;}['get'](_0x1369b1,_0x58fb1c){return __awaiter$2(this,arguments,void 0,function*(_0x21ee7d,_0x1d6219,_0x186115={}){var _0x5ea899;let _0xc9fc59=(_0x5ea899=_0x186115['baseUri'])!==null&&_0x5ea899!==void 0?_0x5ea899:this['baseUri'];!_0xc9fc59['endsWith']('/')&&(_0xc9fc59=_0xc9fc59+'/');_0xc9fc59=_0xc9fc59+'Account/'+_0x1d6219+'/';const _0x2cc8ac=yield Fetch['get'](_0xc9fc59,_0x21ee7d);if(_0x2cc8ac['status']>0xc7&&_0x2cc8ac['status']<0x12c){const _0x11e72c=yield _0x2cc8ac['json']();return new SuccessfulAccountResponse(_0x11e72c);}if(_0x2cc8ac['bodyUsed']){const _0x31aa40=yield _0x2cc8ac['json']();return new FailedAccountResponse(_0x31aa40);}const _0x1e0800={'type':'','status':_0x2cc8ac['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x1e0800);});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xbe58b2,_0x49d0fe,_0x5e20d2,_0x261379){function _0x562931(_0x39889e){return _0x39889e instanceof _0x5e20d2?_0x39889e:new _0x5e20d2(function(_0x2892aa){_0x2892aa(_0x39889e);});}return new(_0x5e20d2||(_0x5e20d2=Promise))(function(_0x4d2471,_0x85ae8a){function _0x4edb75(_0x5a543b){try{_0x3db309(_0x261379['next'](_0x5a543b));}catch(_0x5e297b){_0x85ae8a(_0x5e297b);}}function _0x39f81f(_0x237de){try{_0x3db309(_0x261379['throw'](_0x237de));}catch(_0x3450a5){_0x85ae8a(_0x3450a5);}}function _0x3db309(_0x253c4d){_0x253c4d['done']?_0x4d2471(_0x253c4d['value']):_0x562931(_0x253c4d['value'])['then'](_0x4edb75,_0x39f81f);}_0x3db309((_0x261379=_0x261379['apply'](_0xbe58b2,_0x49d0fe||[]))['next']());});};class TokenManager{constructor(_0x210695){this['securityService']=_0x210695;}['RefreshTokens'](_0x41f744){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x41f744['access_expires'])return new SuccessfulRefreshResponse(_0x41f744);if(Date['now']()>_0x41f744['refresh_expires']){const _0x336cf8={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x336cf8);}const _0x39eab1=yield this['securityService']['refresh'](_0x41f744['refresh_token']);if(!_0x39eab1['isSuccess'])return new FailedRefreshResponse(_0x39eab1['toProblem']());return new SuccessfulRefreshResponse(_0x39eab1['toSuccess']());});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x3ad69e,_0x5cace8,_0x430397,_0x48dab6){function _0x5ab103(_0x3ff3ec){return _0x3ff3ec instanceof _0x430397?_0x3ff3ec:new _0x430397(function(_0x296d1c){_0x296d1c(_0x3ff3ec);});}return new(_0x430397||(_0x430397=Promise))(function(_0x4db515,_0x5b8b5a){function _0x13ba04(_0x4bb6c5){try{_0x18c6ec(_0x48dab6['next'](_0x4bb6c5));}catch(_0x5b732b){_0x5b8b5a(_0x5b732b);}}function _0x11d155(_0x3a6fc1){try{_0x18c6ec(_0x48dab6['throw'](_0x3a6fc1));}catch(_0x452599){_0x5b8b5a(_0x452599);}}function _0x18c6ec(_0x800cda){_0x800cda['done']?_0x4db515(_0x800cda['value']):_0x5ab103(_0x800cda['value'])['then'](_0x13ba04,_0x11d155);}_0x18c6ec((_0x48dab6=_0x48dab6['apply'](_0x3ad69e,_0x5cace8||[]))['next']());});};class SecurityService{constructor(_0x497d82){this['baseUri']=_0x497d82,this['tokenManager']=new TokenManager(this);}['refresh'](_0x473d40){return __awaiter(this,arguments,void 0,function*(_0x4a7b46,_0x4c6ca8={}){var _0x40cebb;let _0x50b01=(_0x40cebb=_0x4c6ca8['baseUri'])!==null&&_0x40cebb!==void 0?_0x40cebb:this['baseUri'];!_0x50b01['endsWith']('/')&&(_0x50b01=_0x50b01+'/');_0x50b01=_0x50b01+'Security/Refresh';const _0x3bd25a=yield Fetch['post'](_0x50b01,_0x4a7b46,null);if(_0x3bd25a['status']>0xc7&&_0x3bd25a['status']<0x12c){const _0x46c97c=yield _0x3bd25a['json']();return new SuccessfulRefreshResponse(_0x46c97c);}if(_0x3bd25a['bodyUsed']){const _0x45bf05=yield _0x3bd25a['json']();return new FailedRefreshResponse(_0x45bf05);}const _0x4eff38={'type':'','status':_0x3bd25a['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x4eff38);});}}
|
|
14
14
|
|
|
15
|
-
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
15
|
+
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
16
16
|
|
|
17
17
|
exports.AdminClient = AdminClient;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
1
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x57eabd,_0x36ba67,_0x41ee23,_0x2acf31){function _0x22bd23(_0xbbe5ca){return _0xbbe5ca instanceof _0x41ee23?_0xbbe5ca:new _0x41ee23(function(_0x2a690e){_0x2a690e(_0xbbe5ca);});}return new(_0x41ee23||(_0x41ee23=Promise))(function(_0x16c429,_0x574c9b){function _0x5b91f8(_0x54ee9f){try{_0x199569(_0x2acf31['next'](_0x54ee9f));}catch(_0x439de0){_0x574c9b(_0x439de0);}}function _0x275cd1(_0x3e88b8){try{_0x199569(_0x2acf31['throw'](_0x3e88b8));}catch(_0x86aab6){_0x574c9b(_0x86aab6);}}function _0x199569(_0x1682e4){_0x1682e4['done']?_0x16c429(_0x1682e4['value']):_0x22bd23(_0x1682e4['value'])['then'](_0x5b91f8,_0x275cd1);}_0x199569((_0x2acf31=_0x2acf31['apply'](_0x57eabd,_0x36ba67||[]))['next']());});};class Fetch{static['get'](_0x18a213,_0xe9c6e5){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x18a213,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xe9c6e5}});});}static['post'](_0x129b94,_0x4a2ae7,_0x46f6d2){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x129b94,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4a2ae7},'body':_0x46f6d2?JSON['stringify'](_0x46f6d2):null});});}static['put'](_0x143fe9,_0x32fa31,_0x3c0102){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x143fe9,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x32fa31},'body':_0x3c0102?JSON['stringify'](_0x3c0102):null});});}static['delete'](_0x4475a4,_0x4e478c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x4475a4,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4e478c}});});}}
|
|
2
2
|
|
|
3
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
3
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x15527d,_0x177f53,_0x4e6cac,_0x392356){function _0x209797(_0x3a9be3){return _0x3a9be3 instanceof _0x4e6cac?_0x3a9be3:new _0x4e6cac(function(_0x1c78f6){_0x1c78f6(_0x3a9be3);});}return new(_0x4e6cac||(_0x4e6cac=Promise))(function(_0x505f6d,_0x1df980){function _0x4e1c7d(_0x476f23){try{_0x197398(_0x392356['next'](_0x476f23));}catch(_0x71d635){_0x1df980(_0x71d635);}}function _0x4d3a9c(_0x5182f5){try{_0x197398(_0x392356['throw'](_0x5182f5));}catch(_0x314167){_0x1df980(_0x314167);}}function _0x197398(_0x5b3c69){_0x5b3c69['done']?_0x505f6d(_0x5b3c69['value']):_0x209797(_0x5b3c69['value'])['then'](_0x4e1c7d,_0x4d3a9c);}_0x197398((_0x392356=_0x392356['apply'](_0x15527d,_0x177f53||[]))['next']());});};class ListService{constructor(_0xd123f8){this['baseUri']=_0xd123f8;}['add'](_0xe66136,_0xc0a37c,_0xd96249){return __awaiter$3(this,arguments,void 0,function*(_0x582bd6,_0x4fd25b,_0x1fdfb3,_0x24942e={}){var _0x271119;let _0x29cb51=(_0x271119=_0x24942e['baseUri'])!==null&&_0x271119!==void 0?_0x271119:this['baseUri'];!_0x29cb51['endsWith']('/')&&(_0x29cb51=_0x29cb51+'/');_0x29cb51=_0x29cb51+'List';const _0x7e52c9={'account_name':_0x4fd25b,'list_name':_0x1fdfb3},_0x633fde=yield Fetch['post'](_0x29cb51,_0x582bd6,_0x7e52c9);if(_0x633fde['status']>0xc7&&_0x633fde['status']<0x12c){const _0x63cb57=yield _0x633fde['json']();return new SuccessfulAccountResponse(_0x63cb57);}if(_0x633fde['bodyUsed']){const _0x4d85a8=yield _0x633fde['json']();return new FailedAccountResponse(_0x4d85a8);}const _0x5b1334={'type':'','status':_0x633fde['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5b1334);});}['remove'](_0x19ab56,_0x4b1345,_0x4718ea){return __awaiter$3(this,arguments,void 0,function*(_0x5661f7,_0x595086,_0x157c1f,_0x4b1e33={}){var _0x1abad1;let _0x2fb13a=(_0x1abad1=_0x4b1e33['baseUri'])!==null&&_0x1abad1!==void 0?_0x1abad1:this['baseUri'];_0x2fb13a=_0x2fb13a+'/List/'+_0x595086+'/'+_0x157c1f;const _0x3fecb5=yield Fetch['delete'](_0x2fb13a,_0x5661f7);if(_0x3fecb5['status']>0xc7&&_0x3fecb5['status']<0x12c){const _0x278fb0=yield _0x3fecb5['json']();return new SuccessfulAccountResponse(_0x278fb0);}if(_0x3fecb5['bodyUsed']){const _0x1cc9a3=yield _0x3fecb5['json']();return new FailedAccountResponse(_0x1cc9a3);}const _0x5b6ccf={'type':'','status':_0x3fecb5['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5b6ccf);});}}
|
|
4
4
|
|
|
5
|
-
class Response{constructor(
|
|
5
|
+
class Response{constructor(_0x5db6a5){this['isSuccess']=_0x5db6a5;}}class SuccessfulAccountResponse extends Response{constructor(_0x1f7188){super(!![]),this['account']=_0x1f7188;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x83fd19){super(![]),this['problem']=_0x83fd19;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x231240){super(!![]),this['tokens']=_0x231240;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x47eb45){super(![]),this['problem']=_0x47eb45;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x28694f,_0x1a9e79,_0x317e6c,_0x161a07){function _0x2a3013(_0x128c13){return _0x128c13 instanceof _0x317e6c?_0x128c13:new _0x317e6c(function(_0x751e4c){_0x751e4c(_0x128c13);});}return new(_0x317e6c||(_0x317e6c=Promise))(function(_0x3c1218,_0x4a75f6){function _0x3511ab(_0x324773){try{_0x4cc1f0(_0x161a07['next'](_0x324773));}catch(_0x56542e){_0x4a75f6(_0x56542e);}}function _0x94cd92(_0x339f9c){try{_0x4cc1f0(_0x161a07['throw'](_0x339f9c));}catch(_0x4b8091){_0x4a75f6(_0x4b8091);}}function _0x4cc1f0(_0xf77f88){_0xf77f88['done']?_0x3c1218(_0xf77f88['value']):_0x2a3013(_0xf77f88['value'])['then'](_0x3511ab,_0x94cd92);}_0x4cc1f0((_0x161a07=_0x161a07['apply'](_0x28694f,_0x1a9e79||[]))['next']());});};class AccountService{constructor(_0x563378){this['baseUri']=_0x563378;}['get'](_0x5d6633,_0x3e9c5d){return __awaiter$2(this,arguments,void 0,function*(_0x13b384,_0x4ac820,_0x51d7f2={}){var _0x56b61a;let _0x3aa3bd=(_0x56b61a=_0x51d7f2['baseUri'])!==null&&_0x56b61a!==void 0?_0x56b61a:this['baseUri'];!_0x3aa3bd['endsWith']('/')&&(_0x3aa3bd=_0x3aa3bd+'/');_0x3aa3bd=_0x3aa3bd+'Account/'+_0x4ac820+'/';const _0xdb77e9=yield Fetch['get'](_0x3aa3bd,_0x13b384);if(_0xdb77e9['status']>0xc7&&_0xdb77e9['status']<0x12c){const _0x362940=yield _0xdb77e9['json']();return new SuccessfulAccountResponse(_0x362940);}if(_0xdb77e9['bodyUsed']){const _0x241707=yield _0xdb77e9['json']();return new FailedAccountResponse(_0x241707);}const _0x3d990b={'type':'','status':_0xdb77e9['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x3d990b);});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x14f533,_0x36061a,_0x4dda07,_0x556141){function _0x518aa6(_0x3feffc){return _0x3feffc instanceof _0x4dda07?_0x3feffc:new _0x4dda07(function(_0x129623){_0x129623(_0x3feffc);});}return new(_0x4dda07||(_0x4dda07=Promise))(function(_0x2102f8,_0x3e8634){function _0x15b2df(_0x40f9d0){try{_0x29497c(_0x556141['next'](_0x40f9d0));}catch(_0x3e0992){_0x3e8634(_0x3e0992);}}function _0x43cce6(_0x40cffc){try{_0x29497c(_0x556141['throw'](_0x40cffc));}catch(_0x4cb5af){_0x3e8634(_0x4cb5af);}}function _0x29497c(_0x5725d9){_0x5725d9['done']?_0x2102f8(_0x5725d9['value']):_0x518aa6(_0x5725d9['value'])['then'](_0x15b2df,_0x43cce6);}_0x29497c((_0x556141=_0x556141['apply'](_0x14f533,_0x36061a||[]))['next']());});};class TokenManager{constructor(_0x3a93d1){this['securityService']=_0x3a93d1;}['RefreshTokens'](_0x20c6a2){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x20c6a2['access_expires'])return new SuccessfulRefreshResponse(_0x20c6a2);if(Date['now']()>_0x20c6a2['refresh_expires']){const _0x230e5c={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x230e5c);}const _0x421d26=yield this['securityService']['refresh'](_0x20c6a2['refresh_token']);if(!_0x421d26['isSuccess'])return new FailedRefreshResponse(_0x421d26['toProblem']());return new SuccessfulRefreshResponse(_0x421d26['toSuccess']());});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x4582be,_0x37e07d,_0x155afa,_0x291eec){function _0x506014(_0x147db7){return _0x147db7 instanceof _0x155afa?_0x147db7:new _0x155afa(function(_0x62764){_0x62764(_0x147db7);});}return new(_0x155afa||(_0x155afa=Promise))(function(_0xd26d61,_0x6acf8e){function _0x5d76a4(_0x4da379){try{_0x6cae41(_0x291eec['next'](_0x4da379));}catch(_0x1f185f){_0x6acf8e(_0x1f185f);}}function _0x334790(_0x59b712){try{_0x6cae41(_0x291eec['throw'](_0x59b712));}catch(_0x34e63d){_0x6acf8e(_0x34e63d);}}function _0x6cae41(_0x4f984e){_0x4f984e['done']?_0xd26d61(_0x4f984e['value']):_0x506014(_0x4f984e['value'])['then'](_0x5d76a4,_0x334790);}_0x6cae41((_0x291eec=_0x291eec['apply'](_0x4582be,_0x37e07d||[]))['next']());});};class SecurityService{constructor(_0x213ef5){this['baseUri']=_0x213ef5,this['tokenManager']=new TokenManager(this);}['refresh'](_0x5f1600){return __awaiter(this,arguments,void 0,function*(_0x5de950,_0x5e7ca1={}){var _0x4a8c01;let _0xed0c89=(_0x4a8c01=_0x5e7ca1['baseUri'])!==null&&_0x4a8c01!==void 0?_0x4a8c01:this['baseUri'];!_0xed0c89['endsWith']('/')&&(_0xed0c89=_0xed0c89+'/');_0xed0c89=_0xed0c89+'Security/Refresh';const _0x2fad28=yield Fetch['post'](_0xed0c89,_0x5de950,null);if(_0x2fad28['status']>0xc7&&_0x2fad28['status']<0x12c){const _0x4fc1e0=yield _0x2fad28['json']();return new SuccessfulRefreshResponse(_0x4fc1e0);}if(_0x2fad28['bodyUsed']){const _0x2ed6f8=yield _0x2fad28['json']();return new FailedRefreshResponse(_0x2ed6f8);}const _0x197b2b={'type':'','status':_0x2fad28['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x197b2b);});}}
|
|
12
12
|
|
|
13
|
-
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
13
|
+
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
14
14
|
|
|
15
15
|
export { AdminClient };
|
package/dist/types.d.ts
CHANGED
|
@@ -4,23 +4,19 @@ declare class AccountService {
|
|
|
4
4
|
get(accessToken: string, accountName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
type AccountService_d_AccountService = AccountService;
|
|
8
|
-
declare const AccountService_d_AccountService: typeof AccountService;
|
|
9
7
|
declare namespace AccountService_d {
|
|
10
|
-
export {
|
|
8
|
+
export { AccountService as default };
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
declare class ListService {
|
|
14
12
|
readonly baseUri: string;
|
|
15
13
|
constructor(baseUri: string);
|
|
16
|
-
add(
|
|
14
|
+
add(access_token: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
|
|
17
15
|
remove(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
type ListService_d_ListService = ListService;
|
|
21
|
-
declare const ListService_d_ListService: typeof ListService;
|
|
22
18
|
declare namespace ListService_d {
|
|
23
|
-
export {
|
|
19
|
+
export { ListService as default };
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
declare class TokenManager {
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x234ec5,_0x2b9fb5,_0x501422,_0x10cc3a){function _0x30a5ab(_0x20508f){return _0x20508f instanceof _0x501422?_0x20508f:new _0x501422(function(_0x4a84a7){_0x4a84a7(_0x20508f);});}return new(_0x501422||(_0x501422=Promise))(function(_0xb8b2cb,_0x4d5355){function _0x25e258(_0x479406){try{_0x4ea12e(_0x10cc3a['next'](_0x479406));}catch(_0x183525){_0x4d5355(_0x183525);}}function _0x2f411c(_0x13ca0e){try{_0x4ea12e(_0x10cc3a['throw'](_0x13ca0e));}catch(_0x5c9f12){_0x4d5355(_0x5c9f12);}}function _0x4ea12e(_0x32449f){_0x32449f['done']?_0xb8b2cb(_0x32449f['value']):_0x30a5ab(_0x32449f['value'])['then'](_0x25e258,_0x2f411c);}_0x4ea12e((_0x10cc3a=_0x10cc3a['apply'](_0x234ec5,_0x2b9fb5||[]))['next']());});};class Fetch{static['get'](_0x5a0a91,_0x495d10){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x5a0a91,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x495d10}});});}static['post'](_0x6068f3,_0x4d687b,_0x32a395){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x6068f3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4d687b},'body':_0x32a395?JSON['stringify'](_0x32a395):null});});}static['put'](_0x1dfb59,_0x27f3a3,_0x34c1bc){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1dfb59,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x27f3a3},'body':_0x34c1bc?JSON['stringify'](_0x34c1bc):null});});}static['delete'](_0x1fb02e,_0x42a5e2){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1fb02e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x42a5e2}});});}}
|
|
2
|
-
|
|
3
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x57a80a,_0x546f46,_0x3f6185,_0x230364){function _0x294a09(_0x22a827){return _0x22a827 instanceof _0x3f6185?_0x22a827:new _0x3f6185(function(_0x1da169){_0x1da169(_0x22a827);});}return new(_0x3f6185||(_0x3f6185=Promise))(function(_0x275a08,_0x3c40c5){function _0x45e889(_0x75138){try{_0x318fa8(_0x230364['next'](_0x75138));}catch(_0x49960d){_0x3c40c5(_0x49960d);}}function _0x563228(_0x3cf7e0){try{_0x318fa8(_0x230364['throw'](_0x3cf7e0));}catch(_0xb20449){_0x3c40c5(_0xb20449);}}function _0x318fa8(_0x2480fe){_0x2480fe['done']?_0x275a08(_0x2480fe['value']):_0x294a09(_0x2480fe['value'])['then'](_0x45e889,_0x563228);}_0x318fa8((_0x230364=_0x230364['apply'](_0x57a80a,_0x546f46||[]))['next']());});};class ListService{constructor(_0x18bde8){this['baseUri']=_0x18bde8;}['add'](_0x4bc300,_0x196ce2,_0x51b72f){return __awaiter$3(this,arguments,void 0,function*(_0x33b3e8,_0x4c169f,_0x2edc01,_0x50e166={}){var _0x37c57f;let _0x132cf7=(_0x37c57f=_0x50e166['baseUri'])!==null&&_0x37c57f!==void 0?_0x37c57f:this['baseUri'];_0x132cf7=_0x132cf7+'/List';const _0x599629={'account_name':_0x4c169f,'list_name':_0x2edc01},_0x470edb=yield Fetch['post'](_0x132cf7,_0x33b3e8,_0x599629);if(_0x470edb['status']>0xc7&&_0x470edb['status']<0x12c){const _0x25d666=yield _0x470edb['json']();return new SuccessfulAccountResponse(_0x25d666);}if(_0x470edb['bodyUsed']){const _0xd5bde=yield _0x470edb['json']();return new FailedAccountResponse(_0xd5bde);}const _0x21e183={'type':'','status':_0x470edb['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x21e183);});}['remove'](_0x1d36c3,_0x370119,_0xd6ab5e){return __awaiter$3(this,arguments,void 0,function*(_0x1f1807,_0x1541fd,_0xb36e2a,_0x5ea2bc={}){var _0x869fdb;let _0x133136=(_0x869fdb=_0x5ea2bc['baseUri'])!==null&&_0x869fdb!==void 0?_0x869fdb:this['baseUri'];_0x133136=_0x133136+'/List/'+_0x1541fd+'/'+_0xb36e2a;const _0x4ed54b=yield Fetch['delete'](_0x133136,_0x1f1807);if(_0x4ed54b['status']>0xc7&&_0x4ed54b['status']<0x12c){const _0x35ceef=yield _0x4ed54b['json']();return new SuccessfulAccountResponse(_0x35ceef);}if(_0x4ed54b['bodyUsed']){const _0x2bd313=yield _0x4ed54b['json']();return new FailedAccountResponse(_0x2bd313);}const _0x4b9aef={'type':'','status':_0x4ed54b['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x4b9aef);});}}
|
|
4
|
-
|
|
5
|
-
class Response{constructor(_0x5b9dde){this['isSuccess']=_0x5b9dde;}}class SuccessfulAccountResponse extends Response{constructor(_0x112c33){super(!![]),this['account']=_0x112c33;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x361d34){super(![]),this['problem']=_0x361d34;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0xefde84){super(!![]),this['tokens']=_0xefde84;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x420aac){super(![]),this['problem']=_0x420aac;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4af589,_0x2a0b63,_0x42f49a,_0x53aa9d){function _0x2e941a(_0x2353f1){return _0x2353f1 instanceof _0x42f49a?_0x2353f1:new _0x42f49a(function(_0x587f80){_0x587f80(_0x2353f1);});}return new(_0x42f49a||(_0x42f49a=Promise))(function(_0x2cb9d5,_0x2f40e5){function _0x20c9a9(_0x207f27){try{_0x44346b(_0x53aa9d['next'](_0x207f27));}catch(_0x4d1cb1){_0x2f40e5(_0x4d1cb1);}}function _0x423645(_0x2a1788){try{_0x44346b(_0x53aa9d['throw'](_0x2a1788));}catch(_0x340716){_0x2f40e5(_0x340716);}}function _0x44346b(_0x3f40a3){_0x3f40a3['done']?_0x2cb9d5(_0x3f40a3['value']):_0x2e941a(_0x3f40a3['value'])['then'](_0x20c9a9,_0x423645);}_0x44346b((_0x53aa9d=_0x53aa9d['apply'](_0x4af589,_0x2a0b63||[]))['next']());});};class AccountService{constructor(_0x346808){this['baseUri']=_0x346808;}['get'](_0x1df9a7,_0x1ec597){return __awaiter$2(this,arguments,void 0,function*(_0x6b2ddc,_0xf23b84,_0x2fe810={}){var _0x5dfef5;let _0x133552=(_0x5dfef5=_0x2fe810['baseUri'])!==null&&_0x5dfef5!==void 0?_0x5dfef5:this['baseUri'];_0x133552=_0x133552+'/Account/'+_0xf23b84+'/';const _0x2a53df=yield Fetch['get'](_0x133552,_0x6b2ddc);if(_0x2a53df['status']>0xc7&&_0x2a53df['status']<0x12c){const _0x4939e6=yield _0x2a53df['json']();return new SuccessfulAccountResponse(_0x4939e6);}if(_0x2a53df['bodyUsed']){const _0x320470=yield _0x2a53df['json']();return new FailedAccountResponse(_0x320470);}const _0x3bb5c0={'type':'','status':_0x2a53df['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x3bb5c0);});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1c9b84,_0x292015,_0x422554,_0x2d67ed){function _0x16ec6c(_0x9a70bd){return _0x9a70bd instanceof _0x422554?_0x9a70bd:new _0x422554(function(_0x34cbd6){_0x34cbd6(_0x9a70bd);});}return new(_0x422554||(_0x422554=Promise))(function(_0x33a328,_0x527465){function _0x32b12f(_0x4b0fb6){try{_0x11d630(_0x2d67ed['next'](_0x4b0fb6));}catch(_0x3cc53d){_0x527465(_0x3cc53d);}}function _0x357945(_0x57a102){try{_0x11d630(_0x2d67ed['throw'](_0x57a102));}catch(_0x4535c7){_0x527465(_0x4535c7);}}function _0x11d630(_0x2f4a3a){_0x2f4a3a['done']?_0x33a328(_0x2f4a3a['value']):_0x16ec6c(_0x2f4a3a['value'])['then'](_0x32b12f,_0x357945);}_0x11d630((_0x2d67ed=_0x2d67ed['apply'](_0x1c9b84,_0x292015||[]))['next']());});};class TokenManager{constructor(_0x153d7f){this['securityService']=_0x153d7f;}['RefreshTokens'](_0x50cd90){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x50cd90['access_expires'])return new SuccessfulRefreshResponse(_0x50cd90);if(Date['now']()>_0x50cd90['refresh_expires']){const _0x1f6a30={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x1f6a30);}const _0x9649bd=yield this['securityService']['refresh'](_0x50cd90['refresh_token']);if(!_0x9649bd['isSuccess'])return new FailedRefreshResponse(_0x9649bd['toProblem']());return new SuccessfulRefreshResponse(_0x9649bd['toSuccess']());});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x5637b1,_0x26d269,_0x55066a,_0x533ac0){function _0x1883d0(_0x17884e){return _0x17884e instanceof _0x55066a?_0x17884e:new _0x55066a(function(_0x518cd1){_0x518cd1(_0x17884e);});}return new(_0x55066a||(_0x55066a=Promise))(function(_0x2b4900,_0x2d70a1){function _0x5ba48a(_0x1e6088){try{_0x3457c9(_0x533ac0['next'](_0x1e6088));}catch(_0x12ea86){_0x2d70a1(_0x12ea86);}}function _0x4ce972(_0x243822){try{_0x3457c9(_0x533ac0['throw'](_0x243822));}catch(_0x11badc){_0x2d70a1(_0x11badc);}}function _0x3457c9(_0x365541){_0x365541['done']?_0x2b4900(_0x365541['value']):_0x1883d0(_0x365541['value'])['then'](_0x5ba48a,_0x4ce972);}_0x3457c9((_0x533ac0=_0x533ac0['apply'](_0x5637b1,_0x26d269||[]))['next']());});};class SecurityService{constructor(_0x4a7fd7){this['baseUri']=_0x4a7fd7,this['tokenManager']=new TokenManager(this);}['refresh'](_0x3c4441){return __awaiter(this,arguments,void 0,function*(_0x13caa8,_0x1700a4={}){var _0x40f5aa;let _0x3ced62=(_0x40f5aa=_0x1700a4['baseUri'])!==null&&_0x40f5aa!==void 0?_0x40f5aa:this['baseUri'];_0x3ced62=_0x3ced62+'/Security/Refresh';const _0x444986=yield Fetch['post'](_0x3ced62,_0x13caa8,null);if(_0x444986['status']>0xc7&&_0x444986['status']<0x12c){const _0x335e2f=yield _0x444986['json']();return new SuccessfulRefreshResponse(_0x335e2f);}if(_0x444986['bodyUsed']){const _0x1dfcbf=yield _0x444986['json']();return new FailedRefreshResponse(_0x1dfcbf);}const _0x2014ae={'type':'','status':_0x444986['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x2014ae);});}}
|
|
12
|
-
|
|
13
|
-
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
14
|
-
|
|
15
|
-
export { AdminClient };
|