@searchability/admin-client 0.0.8 → 0.0.9
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(_0x254144,_0x2b7ad5,_0x49efdf,_0x27bf50){function _0x4cb9da(_0x1c5a68){return _0x1c5a68 instanceof _0x49efdf?_0x1c5a68:new _0x49efdf(function(_0x307872){_0x307872(_0x1c5a68);});}return new(_0x49efdf||(_0x49efdf=Promise))(function(_0x211ff0,_0x5c14a3){function _0x1da2f3(_0x2bbde6){try{_0x4cd967(_0x27bf50['next'](_0x2bbde6));}catch(_0xdce5e5){_0x5c14a3(_0xdce5e5);}}function _0x574a0f(_0x10cf0a){try{_0x4cd967(_0x27bf50['throw'](_0x10cf0a));}catch(_0x4173a3){_0x5c14a3(_0x4173a3);}}function _0x4cd967(_0x2428bd){_0x2428bd['done']?_0x211ff0(_0x2428bd['value']):_0x4cb9da(_0x2428bd['value'])['then'](_0x1da2f3,_0x574a0f);}_0x4cd967((_0x27bf50=_0x27bf50['apply'](_0x254144,_0x2b7ad5||[]))['next']());});};class Fetch{static['get'](_0x5babca,_0x42af0b){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x5babca,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x42af0b}});});}static['post'](_0x19fa58,_0x3c06ff,_0x4d098e){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x19fa58,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3c06ff},'body':_0x4d098e?JSON['stringify'](_0x4d098e):null});});}static['put'](_0x7984e8,_0x558d2f,_0xbf9504){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x7984e8,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x558d2f},'body':_0xbf9504?JSON['stringify'](_0xbf9504):null});});}static['delete'](_0x44b063,_0x433702){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x44b063,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x433702}});});}}
|
|
2
|
+
|
|
3
|
+
class Response{constructor(_0x42c69d){this['isSuccess']=_0x42c69d;}}class SuccessfulAccountResponse extends Response{constructor(_0x2b2093){super(!![]),this['account']=_0x2b2093;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x46530d){super(![]),this['problem']=_0x46530d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x34567d){super(!![]),this['tokens']=_0x34567d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x17d43b){super(![]),this['problem']=_0x17d43b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
|
+
|
|
5
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x67fb41,_0x58f7dc,_0x33967c,_0x6c403f){function _0x48d663(_0x43f9a3){return _0x43f9a3 instanceof _0x33967c?_0x43f9a3:new _0x33967c(function(_0x17f8ca){_0x17f8ca(_0x43f9a3);});}return new(_0x33967c||(_0x33967c=Promise))(function(_0x162cd1,_0x33a0bc){function _0x5c141f(_0x202630){try{_0x5dc01f(_0x6c403f['next'](_0x202630));}catch(_0x5026ba){_0x33a0bc(_0x5026ba);}}function _0x401b2e(_0x2b4fea){try{_0x5dc01f(_0x6c403f['throw'](_0x2b4fea));}catch(_0x2dc54e){_0x33a0bc(_0x2dc54e);}}function _0x5dc01f(_0x4ab038){_0x4ab038['done']?_0x162cd1(_0x4ab038['value']):_0x48d663(_0x4ab038['value'])['then'](_0x5c141f,_0x401b2e);}_0x5dc01f((_0x6c403f=_0x6c403f['apply'](_0x67fb41,_0x58f7dc||[]))['next']());});};class AccountService{constructor(_0x6fb03e){this['baseUri']=_0x6fb03e;}['get'](_0x5e1d8a,_0x1d5300){return __awaiter$3(this,arguments,void 0,function*(_0x42bb23,_0x394994,_0x4b4e04={}){var _0x4951c9;let _0xc20b3=(_0x4951c9=_0x4b4e04['baseUri'])!==null&&_0x4951c9!==void 0?_0x4951c9:this['baseUri'];!_0xc20b3['endsWith']('/')&&(_0xc20b3=_0xc20b3+'/');_0xc20b3=_0xc20b3+'Account/'+_0x394994+'/';const _0x91889b=yield Fetch['get'](_0xc20b3,_0x42bb23);try{if(_0x91889b['status']>0xc7&&_0x91889b['status']<0x12c){const _0x5f0ce5=yield _0x91889b['json']();return new SuccessfulAccountResponse(_0x5f0ce5);}const _0x26a4ae=yield _0x91889b['json']();return new FailedAccountResponse(_0x26a4ae);}catch(_0x28e7c0){if(_0x28e7c0 instanceof Error)return new FailedAccountResponse({'detail':_0x28e7c0['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x28e7c0;}});}}
|
|
6
|
+
|
|
7
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4d2899,_0x5b0cf4,_0x58d6b9,_0x149b13){function _0x5654cb(_0x40dd24){return _0x40dd24 instanceof _0x58d6b9?_0x40dd24:new _0x58d6b9(function(_0x5eceab){_0x5eceab(_0x40dd24);});}return new(_0x58d6b9||(_0x58d6b9=Promise))(function(_0x20f94b,_0x2902d1){function _0x3cbd6a(_0x32f40a){try{_0x225b02(_0x149b13['next'](_0x32f40a));}catch(_0xe815de){_0x2902d1(_0xe815de);}}function _0x4284d6(_0x40a7f1){try{_0x225b02(_0x149b13['throw'](_0x40a7f1));}catch(_0x2c6645){_0x2902d1(_0x2c6645);}}function _0x225b02(_0xc62671){_0xc62671['done']?_0x20f94b(_0xc62671['value']):_0x5654cb(_0xc62671['value'])['then'](_0x3cbd6a,_0x4284d6);}_0x225b02((_0x149b13=_0x149b13['apply'](_0x4d2899,_0x5b0cf4||[]))['next']());});};class ListService{constructor(_0x11145a){this['baseUri']=_0x11145a;}['add'](_0x5636cd,_0x3da14e,_0x466f58){return __awaiter$2(this,arguments,void 0,function*(_0x357074,_0x4225b1,_0x2a5276,_0x3d548f={}){var _0x1ef651;let _0x571cda=(_0x1ef651=_0x3d548f['baseUri'])!==null&&_0x1ef651!==void 0?_0x1ef651:this['baseUri'];!_0x571cda['endsWith']('/')&&(_0x571cda=_0x571cda+'/');_0x571cda=_0x571cda+'List';const _0x2606be={'account_name':_0x4225b1,'list_name':_0x2a5276};try{const _0x413e05=yield Fetch['post'](_0x571cda,_0x357074,_0x2606be);if(_0x413e05['status']>0xc7&&_0x413e05['status']<0x12c){const _0x524384=yield _0x413e05['json']();return new SuccessfulAccountResponse(_0x524384);}const _0x310492=yield _0x413e05['json']();return new FailedAccountResponse(_0x310492);}catch(_0x1e73f2){if(_0x1e73f2 instanceof Error)return new FailedAccountResponse({'detail':_0x1e73f2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1e73f2;}});}['remove'](_0x13f564,_0x2dcdfe,_0x4def68){return __awaiter$2(this,arguments,void 0,function*(_0x2e0cd2,_0x22f3a4,_0x5398c1,_0x2b4d9c={}){var _0x6eed15;let _0x4748cf=(_0x6eed15=_0x2b4d9c['baseUri'])!==null&&_0x6eed15!==void 0?_0x6eed15:this['baseUri'];_0x4748cf=_0x4748cf+'/List/'+_0x22f3a4+'/'+_0x5398c1;const _0x1a6ceb=yield Fetch['delete'](_0x4748cf,_0x2e0cd2);try{if(_0x1a6ceb['status']>0xc7&&_0x1a6ceb['status']<0x12c){const _0x40f51f=yield _0x1a6ceb['json']();return new SuccessfulAccountResponse(_0x40f51f);}const _0x3a0baf=yield _0x1a6ceb['json']();return new FailedAccountResponse(_0x3a0baf);}catch(_0x36e7e6){if(_0x36e7e6 instanceof Error)return new FailedAccountResponse({'detail':_0x36e7e6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x36e7e6;}});}}
|
|
8
|
+
|
|
9
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x336163,_0x5a80d0,_0x47b0ec,_0x33cade){function _0x2f9abd(_0x1bb423){return _0x1bb423 instanceof _0x47b0ec?_0x1bb423:new _0x47b0ec(function(_0x5982cf){_0x5982cf(_0x1bb423);});}return new(_0x47b0ec||(_0x47b0ec=Promise))(function(_0x371fdc,_0x18998d){function _0x4c2a85(_0x2532e1){try{_0x5f2c98(_0x33cade['next'](_0x2532e1));}catch(_0x8d158c){_0x18998d(_0x8d158c);}}function _0x5714ff(_0x46427e){try{_0x5f2c98(_0x33cade['throw'](_0x46427e));}catch(_0x20f020){_0x18998d(_0x20f020);}}function _0x5f2c98(_0x3b7b2f){_0x3b7b2f['done']?_0x371fdc(_0x3b7b2f['value']):_0x2f9abd(_0x3b7b2f['value'])['then'](_0x4c2a85,_0x5714ff);}_0x5f2c98((_0x33cade=_0x33cade['apply'](_0x336163,_0x5a80d0||[]))['next']());});};class TokenManager{constructor(_0x2385ed){this['securityService']=_0x2385ed;}['RefreshTokens'](_0x5e9ee6){return __awaiter$1(this,arguments,void 0,function*(_0x261552,_0x5d3489={}){if(Date['now']()<_0x261552['access_expires'])return new SuccessfulRefreshResponse(_0x261552);if(Date['now']()>_0x261552['refresh_expires']){const _0x4cc3b9={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x4cc3b9);}const _0x4f0e5f=yield this['securityService']['refresh'](_0x261552['refresh_token'],_0x5d3489);if(!_0x4f0e5f['isSuccess'])return new FailedRefreshResponse(_0x4f0e5f['toProblem']());return new SuccessfulRefreshResponse(_0x4f0e5f['toSuccess']());});}}
|
|
10
|
+
|
|
11
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x35eba6,_0x4beae9,_0x54101f,_0x3f12d4){function _0x2a72cf(_0x1b78cd){return _0x1b78cd instanceof _0x54101f?_0x1b78cd:new _0x54101f(function(_0x4373de){_0x4373de(_0x1b78cd);});}return new(_0x54101f||(_0x54101f=Promise))(function(_0x219784,_0x5141e5){function _0x387607(_0x4346e4){try{_0x5d9e8b(_0x3f12d4['next'](_0x4346e4));}catch(_0xabd02d){_0x5141e5(_0xabd02d);}}function _0x5055ae(_0x33719b){try{_0x5d9e8b(_0x3f12d4['throw'](_0x33719b));}catch(_0x4122ae){_0x5141e5(_0x4122ae);}}function _0x5d9e8b(_0x1e0120){_0x1e0120['done']?_0x219784(_0x1e0120['value']):_0x2a72cf(_0x1e0120['value'])['then'](_0x387607,_0x5055ae);}_0x5d9e8b((_0x3f12d4=_0x3f12d4['apply'](_0x35eba6,_0x4beae9||[]))['next']());});};class SecurityService{constructor(_0x7846f8){this['baseUri']=_0x7846f8,this['tokenManager']=new TokenManager(this);}['refresh'](_0x4d22ec){return __awaiter(this,arguments,void 0,function*(_0x11bf35,_0x42bbff={}){var _0x166321;let _0x2ad3d9=(_0x166321=_0x42bbff['baseUri'])!==null&&_0x166321!==void 0?_0x166321:this['baseUri'];!_0x2ad3d9['endsWith']('/')&&(_0x2ad3d9=_0x2ad3d9+'/');_0x2ad3d9=_0x2ad3d9+'Security/Refresh';try{const _0x51ecf9=yield Fetch['post'](_0x2ad3d9,_0x11bf35,null);if(_0x51ecf9['status']>0xc7&&_0x51ecf9['status']<0x12c){const _0x1b0b85=yield _0x51ecf9['json']();return new SuccessfulRefreshResponse(_0x1b0b85);}const _0x3034c4=yield _0x51ecf9['json']();return new FailedRefreshResponse(_0x3034c4);}catch(_0x6dda8d){if(_0x6dda8d instanceof Error)return new FailedRefreshResponse({'detail':_0x6dda8d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x6dda8d;}});}}
|
|
12
|
+
|
|
13
|
+
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
|
|
14
|
+
|
|
15
|
+
export { AdminClient };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
3
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x263785,_0x1251e1,_0x4239dc,_0x29cb06){function _0x43ed29(_0x302007){return _0x302007 instanceof _0x4239dc?_0x302007:new _0x4239dc(function(_0x4172a0){_0x4172a0(_0x302007);});}return new(_0x4239dc||(_0x4239dc=Promise))(function(_0x4fc617,_0xd03815){function _0x64198c(_0x2b5f61){try{_0x3a24fb(_0x29cb06['next'](_0x2b5f61));}catch(_0x5af050){_0xd03815(_0x5af050);}}function _0xab07c1(_0x320556){try{_0x3a24fb(_0x29cb06['throw'](_0x320556));}catch(_0x1326e6){_0xd03815(_0x1326e6);}}function _0x3a24fb(_0x24bbcb){_0x24bbcb['done']?_0x4fc617(_0x24bbcb['value']):_0x43ed29(_0x24bbcb['value'])['then'](_0x64198c,_0xab07c1);}_0x3a24fb((_0x29cb06=_0x29cb06['apply'](_0x263785,_0x1251e1||[]))['next']());});};class Fetch{static['get'](_0x45bd9b,_0x3d91fa){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x45bd9b,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d91fa}});});}static['post'](_0x506586,_0x17f638,_0x1a9d82){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x506586,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x17f638},'body':_0x1a9d82?JSON['stringify'](_0x1a9d82):null});});}static['put'](_0x419393,_0x2acc63,_0x5ae42a){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x419393,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2acc63},'body':_0x5ae42a?JSON['stringify'](_0x5ae42a):null});});}static['delete'](_0x3daa8a,_0x2c7508){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3daa8a,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2c7508}});});}}
|
|
4
4
|
|
|
5
|
-
class Response{constructor(
|
|
5
|
+
class Response{constructor(_0x5484a9){this['isSuccess']=_0x5484a9;}}class SuccessfulAccountResponse extends Response{constructor(_0x3bce59){super(!![]),this['account']=_0x3bce59;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3cfb5a){super(![]),this['problem']=_0x3cfb5a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x505d6d){super(!![]),this['tokens']=_0x505d6d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x34f64d){super(![]),this['problem']=_0x34f64d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3e9056,_0x568886,_0x3d20da,_0x445d5d){function _0x11c3f4(_0x513e30){return _0x513e30 instanceof _0x3d20da?_0x513e30:new _0x3d20da(function(_0x44e8a0){_0x44e8a0(_0x513e30);});}return new(_0x3d20da||(_0x3d20da=Promise))(function(_0x3a6c3d,_0x3497e1){function _0x44e7b8(_0x1a6f22){try{_0x5833c2(_0x445d5d['next'](_0x1a6f22));}catch(_0x1c9eb6){_0x3497e1(_0x1c9eb6);}}function _0x40e923(_0x199922){try{_0x5833c2(_0x445d5d['throw'](_0x199922));}catch(_0x15ac0b){_0x3497e1(_0x15ac0b);}}function _0x5833c2(_0xccae7){_0xccae7['done']?_0x3a6c3d(_0xccae7['value']):_0x11c3f4(_0xccae7['value'])['then'](_0x44e7b8,_0x40e923);}_0x5833c2((_0x445d5d=_0x445d5d['apply'](_0x3e9056,_0x568886||[]))['next']());});};class AccountService{constructor(_0x47bc91){this['baseUri']=_0x47bc91;}['get'](_0x3f1c60,_0x37cd1a){return __awaiter$3(this,arguments,void 0,function*(_0x2a2103,_0x1a510e,_0x517c29={}){var _0xba743;let _0xb04191=(_0xba743=_0x517c29['baseUri'])!==null&&_0xba743!==void 0?_0xba743:this['baseUri'];!_0xb04191['endsWith']('/')&&(_0xb04191=_0xb04191+'/');_0xb04191=_0xb04191+'Account/'+_0x1a510e+'/';const _0xa7b4e=yield Fetch['get'](_0xb04191,_0x2a2103);try{if(_0xa7b4e['status']>0xc7&&_0xa7b4e['status']<0x12c){const _0x43f48c=yield _0xa7b4e['json']();return new SuccessfulAccountResponse(_0x43f48c);}const _0x11c92c=yield _0xa7b4e['json']();return new FailedAccountResponse(_0x11c92c);}catch(_0x226713){if(_0x226713 instanceof Error)return new FailedAccountResponse({'detail':_0x226713['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x226713;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2fbfd2,_0x28aeca,_0x415cdd,_0x171c1d){function _0x102a0b(_0xe2fe6e){return _0xe2fe6e instanceof _0x415cdd?_0xe2fe6e:new _0x415cdd(function(_0x14eb47){_0x14eb47(_0xe2fe6e);});}return new(_0x415cdd||(_0x415cdd=Promise))(function(_0x3cdbd4,_0xb072f6){function _0x42ce3a(_0x35cb48){try{_0x204900(_0x171c1d['next'](_0x35cb48));}catch(_0x4415fc){_0xb072f6(_0x4415fc);}}function _0x5bbe7f(_0x38182c){try{_0x204900(_0x171c1d['throw'](_0x38182c));}catch(_0x57f6f4){_0xb072f6(_0x57f6f4);}}function _0x204900(_0x3c073c){_0x3c073c['done']?_0x3cdbd4(_0x3c073c['value']):_0x102a0b(_0x3c073c['value'])['then'](_0x42ce3a,_0x5bbe7f);}_0x204900((_0x171c1d=_0x171c1d['apply'](_0x2fbfd2,_0x28aeca||[]))['next']());});};class ListService{constructor(_0x4c3fec){this['baseUri']=_0x4c3fec;}['add'](_0x143cf1,_0x294322,_0x17b2c9){return __awaiter$2(this,arguments,void 0,function*(_0x2516e4,_0x5a5f88,_0x3b92b6,_0x320b0f={}){var _0x6199fc;let _0x1504c8=(_0x6199fc=_0x320b0f['baseUri'])!==null&&_0x6199fc!==void 0?_0x6199fc:this['baseUri'];!_0x1504c8['endsWith']('/')&&(_0x1504c8=_0x1504c8+'/');_0x1504c8=_0x1504c8+'List';const _0x44dfe7={'account_name':_0x5a5f88,'list_name':_0x3b92b6};try{const _0x33db75=yield Fetch['post'](_0x1504c8,_0x2516e4,_0x44dfe7);if(_0x33db75['status']>0xc7&&_0x33db75['status']<0x12c){const _0x2afe50=yield _0x33db75['json']();return new SuccessfulAccountResponse(_0x2afe50);}const _0x522fa5=yield _0x33db75['json']();return new FailedAccountResponse(_0x522fa5);}catch(_0xd088f8){if(_0xd088f8 instanceof Error)return new FailedAccountResponse({'detail':_0xd088f8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xd088f8;}});}['remove'](_0x2861fe,_0x416f22,_0x28ec32){return __awaiter$2(this,arguments,void 0,function*(_0x34c175,_0x104d6f,_0x2494ee,_0x27afaa={}){var _0x41117e;let _0x53cf75=(_0x41117e=_0x27afaa['baseUri'])!==null&&_0x41117e!==void 0?_0x41117e:this['baseUri'];_0x53cf75=_0x53cf75+'/List/'+_0x104d6f+'/'+_0x2494ee;const _0x48a990=yield Fetch['delete'](_0x53cf75,_0x34c175);try{if(_0x48a990['status']>0xc7&&_0x48a990['status']<0x12c){const _0x479ad8=yield _0x48a990['json']();return new SuccessfulAccountResponse(_0x479ad8);}const _0x1e4cf1=yield _0x48a990['json']();return new FailedAccountResponse(_0x1e4cf1);}catch(_0x4073df){if(_0x4073df instanceof Error)return new FailedAccountResponse({'detail':_0x4073df['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4073df;}});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x49a44d,_0x4e3b10,_0x3fbf3b,_0x1df522){function _0x3c563c(_0x2a0bf1){return _0x2a0bf1 instanceof _0x3fbf3b?_0x2a0bf1:new _0x3fbf3b(function(_0x77aea7){_0x77aea7(_0x2a0bf1);});}return new(_0x3fbf3b||(_0x3fbf3b=Promise))(function(_0xd2b1f5,_0x1bc1af){function _0x1a8a86(_0x47983b){try{_0x2c3aba(_0x1df522['next'](_0x47983b));}catch(_0x44fde7){_0x1bc1af(_0x44fde7);}}function _0x4a2720(_0x5b5cde){try{_0x2c3aba(_0x1df522['throw'](_0x5b5cde));}catch(_0xf220ca){_0x1bc1af(_0xf220ca);}}function _0x2c3aba(_0x5955c1){_0x5955c1['done']?_0xd2b1f5(_0x5955c1['value']):_0x3c563c(_0x5955c1['value'])['then'](_0x1a8a86,_0x4a2720);}_0x2c3aba((_0x1df522=_0x1df522['apply'](_0x49a44d,_0x4e3b10||[]))['next']());});};class TokenManager{constructor(_0x3d46b6){this['securityService']=_0x3d46b6;}['RefreshTokens'](_0x34f16c){return __awaiter$1(this,arguments,void 0,function*(_0x954761,_0x195d5f={}){if(Date['now']()<_0x954761['access_expires'])return new SuccessfulRefreshResponse(_0x954761);if(Date['now']()>_0x954761['refresh_expires']){const _0xd34af3={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0xd34af3);}const _0x3f80a5=yield this['securityService']['refresh'](_0x954761['refresh_token'],_0x195d5f);if(!_0x3f80a5['isSuccess'])return new FailedRefreshResponse(_0x3f80a5['toProblem']());return new SuccessfulRefreshResponse(_0x3f80a5['toSuccess']());});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x544bf6,_0x316bca,_0x5a36fa,_0x17f1e3){function _0x49c918(_0x4dca5d){return _0x4dca5d instanceof _0x5a36fa?_0x4dca5d:new _0x5a36fa(function(_0x179eb7){_0x179eb7(_0x4dca5d);});}return new(_0x5a36fa||(_0x5a36fa=Promise))(function(_0x284698,_0x5d7de0){function _0x556a01(_0x429a6e){try{_0x37bbcd(_0x17f1e3['next'](_0x429a6e));}catch(_0x3739f7){_0x5d7de0(_0x3739f7);}}function _0x5440ac(_0x4f75c3){try{_0x37bbcd(_0x17f1e3['throw'](_0x4f75c3));}catch(_0x4d8548){_0x5d7de0(_0x4d8548);}}function _0x37bbcd(_0x14c476){_0x14c476['done']?_0x284698(_0x14c476['value']):_0x49c918(_0x14c476['value'])['then'](_0x556a01,_0x5440ac);}_0x37bbcd((_0x17f1e3=_0x17f1e3['apply'](_0x544bf6,_0x316bca||[]))['next']());});};class SecurityService{constructor(_0x220f28){this['baseUri']=_0x220f28,this['tokenManager']=new TokenManager(this);}['refresh'](_0x2dba4b){return __awaiter(this,arguments,void 0,function*(_0x5b9b1f,_0x9c6b56={}){var _0x40c9bd;let _0x2f1dd6=(_0x40c9bd=_0x9c6b56['baseUri'])!==null&&_0x40c9bd!==void 0?_0x40c9bd:this['baseUri'];!_0x2f1dd6['endsWith']('/')&&(_0x2f1dd6=_0x2f1dd6+'/');_0x2f1dd6=_0x2f1dd6+'Security/Refresh';try{const _0x1f2739=yield Fetch['post'](_0x2f1dd6,_0x5b9b1f,null);if(_0x1f2739['status']>0xc7&&_0x1f2739['status']<0x12c){const _0x299464=yield _0x1f2739['json']();return new SuccessfulRefreshResponse(_0x299464);}const _0x710573=yield _0x1f2739['json']();return new FailedRefreshResponse(_0x710573);}catch(_0x3d8169){if(_0x3d8169 instanceof Error)return new FailedRefreshResponse({'detail':_0x3d8169['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3d8169;}});}}
|
|
14
14
|
|
|
15
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
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
1
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4d1520,_0x5d7cd9,_0x597bd6,_0x201d41){function _0x4fd560(_0x431628){return _0x431628 instanceof _0x597bd6?_0x431628:new _0x597bd6(function(_0x4eb038){_0x4eb038(_0x431628);});}return new(_0x597bd6||(_0x597bd6=Promise))(function(_0x4e0554,_0x22b8fa){function _0x1aa517(_0x2ff1b5){try{_0x54e126(_0x201d41['next'](_0x2ff1b5));}catch(_0x52e590){_0x22b8fa(_0x52e590);}}function _0x8d5a81(_0x23e7e0){try{_0x54e126(_0x201d41['throw'](_0x23e7e0));}catch(_0x10c066){_0x22b8fa(_0x10c066);}}function _0x54e126(_0x1e5ef8){_0x1e5ef8['done']?_0x4e0554(_0x1e5ef8['value']):_0x4fd560(_0x1e5ef8['value'])['then'](_0x1aa517,_0x8d5a81);}_0x54e126((_0x201d41=_0x201d41['apply'](_0x4d1520,_0x5d7cd9||[]))['next']());});};class Fetch{static['get'](_0x1aa9d4,_0x2363ad){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1aa9d4,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2363ad}});});}static['post'](_0x368c1b,_0x561709,_0x6a3419){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x368c1b,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x561709},'body':_0x6a3419?JSON['stringify'](_0x6a3419):null});});}static['put'](_0x4d81cd,_0x14469c,_0x186b56){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x4d81cd,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x14469c},'body':_0x186b56?JSON['stringify'](_0x186b56):null});});}static['delete'](_0x3ddb2d,_0xa4315a){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3ddb2d,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xa4315a}});});}}
|
|
2
2
|
|
|
3
|
-
class Response{constructor(
|
|
3
|
+
class Response{constructor(_0x3389d3){this['isSuccess']=_0x3389d3;}}class SuccessfulAccountResponse extends Response{constructor(_0x35bd2c){super(!![]),this['account']=_0x35bd2c;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2dc3c2){super(![]),this['problem']=_0x2dc3c2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x273e05){super(!![]),this['tokens']=_0x273e05;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0xd399c3){super(![]),this['problem']=_0xd399c3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x330619,_0x26840a,_0x181502,_0x315ff1){function _0x552030(_0x5b7420){return _0x5b7420 instanceof _0x181502?_0x5b7420:new _0x181502(function(_0x35643e){_0x35643e(_0x5b7420);});}return new(_0x181502||(_0x181502=Promise))(function(_0x2d66df,_0x9f3f5){function _0x11ace0(_0x2495db){try{_0xd21853(_0x315ff1['next'](_0x2495db));}catch(_0xcd4de){_0x9f3f5(_0xcd4de);}}function _0x1e48f2(_0x31149d){try{_0xd21853(_0x315ff1['throw'](_0x31149d));}catch(_0x479705){_0x9f3f5(_0x479705);}}function _0xd21853(_0x5e9bdb){_0x5e9bdb['done']?_0x2d66df(_0x5e9bdb['value']):_0x552030(_0x5e9bdb['value'])['then'](_0x11ace0,_0x1e48f2);}_0xd21853((_0x315ff1=_0x315ff1['apply'](_0x330619,_0x26840a||[]))['next']());});};class AccountService{constructor(_0x3835c0){this['baseUri']=_0x3835c0;}['get'](_0x495c52,_0x5995d4){return __awaiter$3(this,arguments,void 0,function*(_0xeb63b3,_0x3996f8,_0x13dd8c={}){var _0x76c58;let _0x4555c3=(_0x76c58=_0x13dd8c['baseUri'])!==null&&_0x76c58!==void 0?_0x76c58:this['baseUri'];!_0x4555c3['endsWith']('/')&&(_0x4555c3=_0x4555c3+'/');_0x4555c3=_0x4555c3+'Account/'+_0x3996f8+'/';const _0x2148b9=yield Fetch['get'](_0x4555c3,_0xeb63b3);try{if(_0x2148b9['status']>0xc7&&_0x2148b9['status']<0x12c){const _0x2017b1=yield _0x2148b9['json']();return new SuccessfulAccountResponse(_0x2017b1);}const _0x229704=yield _0x2148b9['json']();return new FailedAccountResponse(_0x229704);}catch(_0x1b2690){if(_0x1b2690 instanceof Error)return new FailedAccountResponse({'detail':_0x1b2690['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1b2690;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2decd7,_0x5d8cb5,_0x90caa9,_0x1ff7f1){function _0x1981c0(_0x50eb33){return _0x50eb33 instanceof _0x90caa9?_0x50eb33:new _0x90caa9(function(_0x2d62d8){_0x2d62d8(_0x50eb33);});}return new(_0x90caa9||(_0x90caa9=Promise))(function(_0x1bfbbc,_0x5b3993){function _0x2b04fa(_0x47ef71){try{_0x30f3c9(_0x1ff7f1['next'](_0x47ef71));}catch(_0x576846){_0x5b3993(_0x576846);}}function _0x592955(_0x193783){try{_0x30f3c9(_0x1ff7f1['throw'](_0x193783));}catch(_0x57d1a7){_0x5b3993(_0x57d1a7);}}function _0x30f3c9(_0xcbc45c){_0xcbc45c['done']?_0x1bfbbc(_0xcbc45c['value']):_0x1981c0(_0xcbc45c['value'])['then'](_0x2b04fa,_0x592955);}_0x30f3c9((_0x1ff7f1=_0x1ff7f1['apply'](_0x2decd7,_0x5d8cb5||[]))['next']());});};class ListService{constructor(_0x2892e0){this['baseUri']=_0x2892e0;}['add'](_0x58d1e2,_0x2e4c95,_0x2311bc){return __awaiter$2(this,arguments,void 0,function*(_0x23a54a,_0x428c1a,_0x13cf27,_0x249557={}){var _0x3533fb;let _0x40dd3a=(_0x3533fb=_0x249557['baseUri'])!==null&&_0x3533fb!==void 0?_0x3533fb:this['baseUri'];!_0x40dd3a['endsWith']('/')&&(_0x40dd3a=_0x40dd3a+'/');_0x40dd3a=_0x40dd3a+'List';const _0x7a131={'account_name':_0x428c1a,'list_name':_0x13cf27};try{const _0x1ab64b=yield Fetch['post'](_0x40dd3a,_0x23a54a,_0x7a131);if(_0x1ab64b['status']>0xc7&&_0x1ab64b['status']<0x12c){const _0x3d646d=yield _0x1ab64b['json']();return new SuccessfulAccountResponse(_0x3d646d);}const _0x1850cb=yield _0x1ab64b['json']();return new FailedAccountResponse(_0x1850cb);}catch(_0x317156){if(_0x317156 instanceof Error)return new FailedAccountResponse({'detail':_0x317156['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x317156;}});}['remove'](_0x4ccb2,_0x3983c2,_0x5e7fec){return __awaiter$2(this,arguments,void 0,function*(_0x41e0e3,_0x4aad20,_0x493b68,_0x25d7a9={}){var _0x49d098;let _0x160ccf=(_0x49d098=_0x25d7a9['baseUri'])!==null&&_0x49d098!==void 0?_0x49d098:this['baseUri'];_0x160ccf=_0x160ccf+'/List/'+_0x4aad20+'/'+_0x493b68;const _0xb06e87=yield Fetch['delete'](_0x160ccf,_0x41e0e3);try{if(_0xb06e87['status']>0xc7&&_0xb06e87['status']<0x12c){const _0x2eac87=yield _0xb06e87['json']();return new SuccessfulAccountResponse(_0x2eac87);}const _0x392295=yield _0xb06e87['json']();return new FailedAccountResponse(_0x392295);}catch(_0x538d47){if(_0x538d47 instanceof Error)return new FailedAccountResponse({'detail':_0x538d47['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x538d47;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x47778c,_0x363a13,_0x3d2f66,_0x2e7ec9){function _0x169e6f(_0x3aaa49){return _0x3aaa49 instanceof _0x3d2f66?_0x3aaa49:new _0x3d2f66(function(_0xee1d8d){_0xee1d8d(_0x3aaa49);});}return new(_0x3d2f66||(_0x3d2f66=Promise))(function(_0x41ddc3,_0x572127){function _0x5922d0(_0x229bc2){try{_0x498bb2(_0x2e7ec9['next'](_0x229bc2));}catch(_0x22314a){_0x572127(_0x22314a);}}function _0x25459c(_0x34c9cc){try{_0x498bb2(_0x2e7ec9['throw'](_0x34c9cc));}catch(_0x18c65a){_0x572127(_0x18c65a);}}function _0x498bb2(_0x2c82c6){_0x2c82c6['done']?_0x41ddc3(_0x2c82c6['value']):_0x169e6f(_0x2c82c6['value'])['then'](_0x5922d0,_0x25459c);}_0x498bb2((_0x2e7ec9=_0x2e7ec9['apply'](_0x47778c,_0x363a13||[]))['next']());});};class TokenManager{constructor(_0x5b92c6){this['securityService']=_0x5b92c6;}['RefreshTokens'](_0x35c1fc){return __awaiter$1(this,arguments,void 0,function*(_0x5f02d9,_0x39b888={}){if(Date['now']()<_0x5f02d9['access_expires'])return new SuccessfulRefreshResponse(_0x5f02d9);if(Date['now']()>_0x5f02d9['refresh_expires']){const _0x2ac8e9={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x2ac8e9);}const _0x4faa76=yield this['securityService']['refresh'](_0x5f02d9['refresh_token'],_0x39b888);if(!_0x4faa76['isSuccess'])return new FailedRefreshResponse(_0x4faa76['toProblem']());return new SuccessfulRefreshResponse(_0x4faa76['toSuccess']());});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x367cf6,_0x1299f4,_0x531813,_0x27cc36){function _0x68b187(_0xa6e51b){return _0xa6e51b instanceof _0x531813?_0xa6e51b:new _0x531813(function(_0x4f02c6){_0x4f02c6(_0xa6e51b);});}return new(_0x531813||(_0x531813=Promise))(function(_0x8df339,_0x1d5f68){function _0x1a61a1(_0x51ba71){try{_0x3a0325(_0x27cc36['next'](_0x51ba71));}catch(_0x4c077d){_0x1d5f68(_0x4c077d);}}function _0xc5d8b3(_0x9bd8dd){try{_0x3a0325(_0x27cc36['throw'](_0x9bd8dd));}catch(_0x228df6){_0x1d5f68(_0x228df6);}}function _0x3a0325(_0x3da4f3){_0x3da4f3['done']?_0x8df339(_0x3da4f3['value']):_0x68b187(_0x3da4f3['value'])['then'](_0x1a61a1,_0xc5d8b3);}_0x3a0325((_0x27cc36=_0x27cc36['apply'](_0x367cf6,_0x1299f4||[]))['next']());});};class SecurityService{constructor(_0x2c12ff){this['baseUri']=_0x2c12ff,this['tokenManager']=new TokenManager(this);}['refresh'](_0x11ea2e){return __awaiter(this,arguments,void 0,function*(_0x3712da,_0x48aebe={}){var _0x31df9e;let _0xee8de2=(_0x31df9e=_0x48aebe['baseUri'])!==null&&_0x31df9e!==void 0?_0x31df9e:this['baseUri'];!_0xee8de2['endsWith']('/')&&(_0xee8de2=_0xee8de2+'/');_0xee8de2=_0xee8de2+'Security/Refresh';try{const _0x58b38a=yield Fetch['post'](_0xee8de2,_0x3712da,null);if(_0x58b38a['status']>0xc7&&_0x58b38a['status']<0x12c){const _0x16ab6f=yield _0x58b38a['json']();return new SuccessfulRefreshResponse(_0x16ab6f);}const _0x31c82f=yield _0x58b38a['json']();return new FailedRefreshResponse(_0x31c82f);}catch(_0x174d0d){if(_0x174d0d instanceof Error)return new FailedRefreshResponse({'detail':_0x174d0d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x174d0d;}});}}
|
|
12
12
|
|
|
13
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
|
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2cff20,_0x5442f5,_0x167e7e,_0x34cb7a){function _0x386c69(_0x4677b4){return _0x4677b4 instanceof _0x167e7e?_0x4677b4:new _0x167e7e(function(_0xdb9814){_0xdb9814(_0x4677b4);});}return new(_0x167e7e||(_0x167e7e=Promise))(function(_0x2bbfb4,_0x399d6b){function _0x1946c5(_0xa3a44e){try{_0x181e0b(_0x34cb7a['next'](_0xa3a44e));}catch(_0x27a199){_0x399d6b(_0x27a199);}}function _0x89c149(_0xa237d8){try{_0x181e0b(_0x34cb7a['throw'](_0xa237d8));}catch(_0x20ad36){_0x399d6b(_0x20ad36);}}function _0x181e0b(_0x1a0a9f){_0x1a0a9f['done']?_0x2bbfb4(_0x1a0a9f['value']):_0x386c69(_0x1a0a9f['value'])['then'](_0x1946c5,_0x89c149);}_0x181e0b((_0x34cb7a=_0x34cb7a['apply'](_0x2cff20,_0x5442f5||[]))['next']());});};class Fetch{static['get'](_0x706446,_0x2ae69c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x706446,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2ae69c}});});}static['post'](_0x56c368,_0x58b7f2,_0x27a974){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x56c368,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x58b7f2},'body':_0x27a974?JSON['stringify'](_0x27a974):null});});}static['put'](_0x369fde,_0x56ed2e,_0x4c70d6){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x369fde,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x56ed2e},'body':_0x4c70d6?JSON['stringify'](_0x4c70d6):null});});}static['delete'](_0x54eba5,_0x5c09d5){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x54eba5,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5c09d5}});});}}
|
|
2
|
-
|
|
3
|
-
class Response{constructor(_0x59970d){this['isSuccess']=_0x59970d;}}class SuccessfulAccountResponse extends Response{constructor(_0x18096a){super(!![]),this['account']=_0x18096a;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x217ed1){super(![]),this['problem']=_0x217ed1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x165c91){super(!![]),this['tokens']=_0x165c91;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x1cff2e){super(![]),this['problem']=_0x1cff2e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
|
-
|
|
5
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x598296,_0x3eb87b,_0x3c2aa8,_0x3a6ab0){function _0x3870b8(_0x20cbe3){return _0x20cbe3 instanceof _0x3c2aa8?_0x20cbe3:new _0x3c2aa8(function(_0x561f68){_0x561f68(_0x20cbe3);});}return new(_0x3c2aa8||(_0x3c2aa8=Promise))(function(_0x329093,_0x12fda3){function _0x569ea6(_0x1352cb){try{_0x115968(_0x3a6ab0['next'](_0x1352cb));}catch(_0x24db1e){_0x12fda3(_0x24db1e);}}function _0x3db789(_0x34e6f0){try{_0x115968(_0x3a6ab0['throw'](_0x34e6f0));}catch(_0x2eb4d8){_0x12fda3(_0x2eb4d8);}}function _0x115968(_0x1ffedf){_0x1ffedf['done']?_0x329093(_0x1ffedf['value']):_0x3870b8(_0x1ffedf['value'])['then'](_0x569ea6,_0x3db789);}_0x115968((_0x3a6ab0=_0x3a6ab0['apply'](_0x598296,_0x3eb87b||[]))['next']());});};class AccountService{constructor(_0x5d4f70){this['baseUri']=_0x5d4f70;}['get'](_0x13c9ef,_0x53fa98){return __awaiter$3(this,arguments,void 0,function*(_0x537cd2,_0x4a1daf,_0x50f71a={}){var _0x22b999;let _0x211bd3=(_0x22b999=_0x50f71a['baseUri'])!==null&&_0x22b999!==void 0?_0x22b999:this['baseUri'];!_0x211bd3['endsWith']('/')&&(_0x211bd3=_0x211bd3+'/');_0x211bd3=_0x211bd3+'Account/'+_0x4a1daf+'/';const _0x198c77=yield Fetch['get'](_0x211bd3,_0x537cd2);try{if(_0x198c77['status']>0xc7&&_0x198c77['status']<0x12c){const _0x342e21=yield _0x198c77['json']();return new SuccessfulAccountResponse(_0x342e21);}const _0x1c8e8d=yield _0x198c77['json']();return new FailedAccountResponse(_0x1c8e8d);}catch(_0xe8bb28){if(_0xe8bb28 instanceof Error)return new FailedAccountResponse({'detail':_0xe8bb28['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xe8bb28;}});}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x194318,_0x5abc0c,_0x2fb170,_0x4b8b7c){function _0x45d9cb(_0x541db){return _0x541db instanceof _0x2fb170?_0x541db:new _0x2fb170(function(_0x466e58){_0x466e58(_0x541db);});}return new(_0x2fb170||(_0x2fb170=Promise))(function(_0x4752e3,_0x557e17){function _0x536b58(_0x5f2db1){try{_0x153f68(_0x4b8b7c['next'](_0x5f2db1));}catch(_0x3e2aeb){_0x557e17(_0x3e2aeb);}}function _0x56d389(_0x4d1fde){try{_0x153f68(_0x4b8b7c['throw'](_0x4d1fde));}catch(_0x4b5188){_0x557e17(_0x4b5188);}}function _0x153f68(_0x36c095){_0x36c095['done']?_0x4752e3(_0x36c095['value']):_0x45d9cb(_0x36c095['value'])['then'](_0x536b58,_0x56d389);}_0x153f68((_0x4b8b7c=_0x4b8b7c['apply'](_0x194318,_0x5abc0c||[]))['next']());});};class ListService{constructor(_0x7a200a){this['baseUri']=_0x7a200a;}['add'](_0x351367,_0x7652a,_0x8858f3){return __awaiter$2(this,arguments,void 0,function*(_0x15df6c,_0x3fb823,_0x18c57d,_0x295dd3={}){var _0x5b02ce;let _0x1744be=(_0x5b02ce=_0x295dd3['baseUri'])!==null&&_0x5b02ce!==void 0?_0x5b02ce:this['baseUri'];!_0x1744be['endsWith']('/')&&(_0x1744be=_0x1744be+'/');_0x1744be=_0x1744be+'List';const _0x100b44={'account_name':_0x3fb823,'list_name':_0x18c57d};try{const _0x3c03fd=yield Fetch['post'](_0x1744be,_0x15df6c,_0x100b44);if(_0x3c03fd['status']>0xc7&&_0x3c03fd['status']<0x12c){const _0x5517af=yield _0x3c03fd['json']();return new SuccessfulAccountResponse(_0x5517af);}const _0xd9d7b5=yield _0x3c03fd['json']();return new FailedAccountResponse(_0xd9d7b5);}catch(_0x53aff3){if(_0x53aff3 instanceof Error)return new FailedAccountResponse({'detail':_0x53aff3['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x53aff3;}});}['remove'](_0x3515ab,_0x1ca46c,_0x2b185a){return __awaiter$2(this,arguments,void 0,function*(_0x1fee2b,_0x25f937,_0x221f40,_0x43990a={}){var _0x4bc1e8;let _0x4de987=(_0x4bc1e8=_0x43990a['baseUri'])!==null&&_0x4bc1e8!==void 0?_0x4bc1e8:this['baseUri'];_0x4de987=_0x4de987+'/List/'+_0x25f937+'/'+_0x221f40;const _0x3a217f=yield Fetch['delete'](_0x4de987,_0x1fee2b);try{if(_0x3a217f['status']>0xc7&&_0x3a217f['status']<0x12c){const _0x21aaf3=yield _0x3a217f['json']();return new SuccessfulAccountResponse(_0x21aaf3);}const _0xaad654=yield _0x3a217f['json']();return new FailedAccountResponse(_0xaad654);}catch(_0x14054c){if(_0x14054c instanceof Error)return new FailedAccountResponse({'detail':_0x14054c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x14054c;}});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x4986c2,_0x5b9136,_0x26daf6,_0x291128){function _0x15a75a(_0x3fae56){return _0x3fae56 instanceof _0x26daf6?_0x3fae56:new _0x26daf6(function(_0x11f73b){_0x11f73b(_0x3fae56);});}return new(_0x26daf6||(_0x26daf6=Promise))(function(_0x2f5ad4,_0x3c3003){function _0x5a7630(_0x52756e){try{_0x294dd6(_0x291128['next'](_0x52756e));}catch(_0x584e70){_0x3c3003(_0x584e70);}}function _0x168f06(_0x55d234){try{_0x294dd6(_0x291128['throw'](_0x55d234));}catch(_0x4f9462){_0x3c3003(_0x4f9462);}}function _0x294dd6(_0x1d1a0f){_0x1d1a0f['done']?_0x2f5ad4(_0x1d1a0f['value']):_0x15a75a(_0x1d1a0f['value'])['then'](_0x5a7630,_0x168f06);}_0x294dd6((_0x291128=_0x291128['apply'](_0x4986c2,_0x5b9136||[]))['next']());});};class TokenManager{constructor(_0x1a5694){this['securityService']=_0x1a5694;}['RefreshTokens'](_0x19fb29){return __awaiter$1(this,arguments,void 0,function*(_0x552e1c,_0x4062e0={}){if(Date['now']()<_0x552e1c['access_expires'])return new SuccessfulRefreshResponse(_0x552e1c);if(Date['now']()>_0x552e1c['refresh_expires']){const _0x2775b4={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x2775b4);}const _0x3f71b8=yield this['securityService']['refresh'](_0x552e1c['refresh_token'],_0x4062e0);if(!_0x3f71b8['isSuccess'])return new FailedRefreshResponse(_0x3f71b8['toProblem']());return new SuccessfulRefreshResponse(_0x3f71b8['toSuccess']());});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x343323,_0x4250e9,_0x5c1ab1,_0x195747){function _0x1af5f9(_0x4c6954){return _0x4c6954 instanceof _0x5c1ab1?_0x4c6954:new _0x5c1ab1(function(_0x2f3eca){_0x2f3eca(_0x4c6954);});}return new(_0x5c1ab1||(_0x5c1ab1=Promise))(function(_0x23e370,_0x3d0ddd){function _0x20b4c7(_0x1de192){try{_0x41b2ce(_0x195747['next'](_0x1de192));}catch(_0x5cace7){_0x3d0ddd(_0x5cace7);}}function _0x3dd326(_0x572b32){try{_0x41b2ce(_0x195747['throw'](_0x572b32));}catch(_0x500ae7){_0x3d0ddd(_0x500ae7);}}function _0x41b2ce(_0x56d32a){_0x56d32a['done']?_0x23e370(_0x56d32a['value']):_0x1af5f9(_0x56d32a['value'])['then'](_0x20b4c7,_0x3dd326);}_0x41b2ce((_0x195747=_0x195747['apply'](_0x343323,_0x4250e9||[]))['next']());});};class SecurityService{constructor(_0x3dbc0f){this['baseUri']=_0x3dbc0f,this['tokenManager']=new TokenManager(this);}['refresh'](_0x78c5ef){return __awaiter(this,arguments,void 0,function*(_0x156c27,_0x4dc098={}){var _0x2ec09c;let _0x5680df=(_0x2ec09c=_0x4dc098['baseUri'])!==null&&_0x2ec09c!==void 0?_0x2ec09c:this['baseUri'];!_0x5680df['endsWith']('/')&&(_0x5680df=_0x5680df+'/');_0x5680df=_0x5680df+'Security/Refresh';try{const _0x47337d=yield Fetch['post'](_0x5680df,_0x156c27,null);if(_0x47337d['status']>0xc7&&_0x47337d['status']<0x12c){const _0x5512c6=yield _0x47337d['json']();return new SuccessfulRefreshResponse(_0x5512c6);}const _0x162b2e=yield _0x47337d['json']();return new FailedRefreshResponse(_0x162b2e);}catch(_0x5588be){if(_0x5588be instanceof Error)return new FailedRefreshResponse({'detail':_0x5588be['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5588be;}});}}
|
|
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 };
|