@searchability/admin-client 0.0.19 → 0.0.20
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
|
+
undefined&&undefined['__awaiter']||function(_0x1e22eb,_0xeced25,_0x42d7ed,_0x5df34c){function _0x10370c(_0x1f96dc){return _0x1f96dc instanceof _0x42d7ed?_0x1f96dc:new _0x42d7ed(function(_0x4af985){_0x4af985(_0x1f96dc);});}return new(_0x42d7ed||(_0x42d7ed=Promise))(function(_0x5f1ee5,_0x3a6b8f){function _0x9a541e(_0xe837ad){try{_0x5daacf(_0x5df34c['next'](_0xe837ad));}catch(_0x23af2e){_0x3a6b8f(_0x23af2e);}}function _0x5120eb(_0x332b01){try{_0x5daacf(_0x5df34c['throw'](_0x332b01));}catch(_0x1fac20){_0x3a6b8f(_0x1fac20);}}function _0x5daacf(_0x10b532){_0x10b532['done']?_0x5f1ee5(_0x10b532['value']):_0x10370c(_0x10b532['value'])['then'](_0x9a541e,_0x5120eb);}_0x5daacf((_0x5df34c=_0x5df34c['apply'](_0x1e22eb,_0xeced25||[]))['next']());});};
|
|
2
|
+
|
|
3
|
+
class Response{constructor(_0x1ee854){this['isSuccess']=_0x1ee854;}}class SuccessfulAccountResponse extends Response{constructor(_0x36834a){super(!![]),this['account']=_0x36834a;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x289130){super(![]),this['problem']=_0x289130;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0xe7a6f0){super(!![]),this['tokens']=_0xe7a6f0;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x76633){super(![]),this['problem']=_0x76633;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x1a7ff9){super(!![]),this['apiKeys']=_0x1a7ff9;}['toSuccess'](){return this['apiKeys'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x277ac3){super(![]),this['problem']=_0x277ac3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
|
+
|
|
5
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4ad6d6,_0x2fa10e,_0x4db4bc,_0x44d2b9){function _0x5a53ba(_0x1b182d){return _0x1b182d instanceof _0x4db4bc?_0x1b182d:new _0x4db4bc(function(_0x5aa025){_0x5aa025(_0x1b182d);});}return new(_0x4db4bc||(_0x4db4bc=Promise))(function(_0x1919d5,_0x57d3ef){function _0x4e1a7b(_0x59d79b){try{_0x348477(_0x44d2b9['next'](_0x59d79b));}catch(_0x543cff){_0x57d3ef(_0x543cff);}}function _0xc6ae39(_0x1225c8){try{_0x348477(_0x44d2b9['throw'](_0x1225c8));}catch(_0x18c148){_0x57d3ef(_0x18c148);}}function _0x348477(_0x531a2a){_0x531a2a['done']?_0x1919d5(_0x531a2a['value']):_0x5a53ba(_0x531a2a['value'])['then'](_0x4e1a7b,_0xc6ae39);}_0x348477((_0x44d2b9=_0x44d2b9['apply'](_0x4ad6d6,_0x2fa10e||[]))['next']());});};class AccountService{constructor(_0x9d8414){this['fetch']=_0x9d8414;}['get'](_0x1bb848,_0x3d0ef1){return __awaiter$4(this,void 0,void 0,function*(){const _0x5a39ae='Account/'+_0x1bb848+'/',_0x2977c3=yield this['fetch']['get'](_0x5a39ae,_0x3d0ef1);try{if(_0x2977c3['status']>0xc7&&_0x2977c3['status']<0x12c){const _0x167aa4=yield _0x2977c3['json']();return new SuccessfulAccountResponse(_0x167aa4);}const _0xb2a59f=yield _0x2977c3['json']();return new FailedAccountResponse(_0xb2a59f);}catch(_0x3fc39b){if(_0x3fc39b instanceof Error)return new FailedAccountResponse({'detail':_0x3fc39b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3fc39b;}});}}
|
|
6
|
+
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x19924e,_0x276b8b,_0x37c97d,_0x42e76b){function _0x174cf2(_0x40f005){return _0x40f005 instanceof _0x37c97d?_0x40f005:new _0x37c97d(function(_0x33560b){_0x33560b(_0x40f005);});}return new(_0x37c97d||(_0x37c97d=Promise))(function(_0x432fc0,_0x544725){function _0x50da0e(_0x5ebbf0){try{_0x1fd4de(_0x42e76b['next'](_0x5ebbf0));}catch(_0x20ea43){_0x544725(_0x20ea43);}}function _0xfb184d(_0x49de2d){try{_0x1fd4de(_0x42e76b['throw'](_0x49de2d));}catch(_0x3c2394){_0x544725(_0x3c2394);}}function _0x1fd4de(_0x11dd49){_0x11dd49['done']?_0x432fc0(_0x11dd49['value']):_0x174cf2(_0x11dd49['value'])['then'](_0x50da0e,_0xfb184d);}_0x1fd4de((_0x42e76b=_0x42e76b['apply'](_0x19924e,_0x276b8b||[]))['next']());});};class ApiKeyService{constructor(_0x58f92a){this['fetch']=_0x58f92a;}['create'](_0x772f3,_0xd2be52,_0xa583fb){return __awaiter$3(this,void 0,void 0,function*(){const _0x6fc91f='ApiKey/Create',_0xca4585={'account_name':_0x772f3,'name':_0xd2be52};try{const _0x1e859f=yield this['fetch']['post'](_0x6fc91f,_0xa583fb,_0xca4585);if(_0x1e859f['status']>0xc7&&_0x1e859f['status']<0x12c){const _0x79a245=yield _0x1e859f['json']();return new SuccessfulApiKeyResponse(_0x79a245);}const _0x15f500=yield _0x1e859f['json']();return new FailedApiKeyResponse(_0x15f500);}catch(_0x1a6b6d){if(_0x1a6b6d instanceof Error)return new FailedApiKeyResponse({'detail':_0x1a6b6d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1a6b6d;}});}}
|
|
8
|
+
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x5314d2,_0x55e2a6,_0xaa086f,_0x23c27e){function _0x1ffbcd(_0x5d2339){return _0x5d2339 instanceof _0xaa086f?_0x5d2339:new _0xaa086f(function(_0x3eddc9){_0x3eddc9(_0x5d2339);});}return new(_0xaa086f||(_0xaa086f=Promise))(function(_0x1bec73,_0x29ba20){function _0x29ab73(_0x8a3eab){try{_0x22e7a3(_0x23c27e['next'](_0x8a3eab));}catch(_0x2ae0f1){_0x29ba20(_0x2ae0f1);}}function _0x44febc(_0x201965){try{_0x22e7a3(_0x23c27e['throw'](_0x201965));}catch(_0x793099){_0x29ba20(_0x793099);}}function _0x22e7a3(_0x55524a){_0x55524a['done']?_0x1bec73(_0x55524a['value']):_0x1ffbcd(_0x55524a['value'])['then'](_0x29ab73,_0x44febc);}_0x22e7a3((_0x23c27e=_0x23c27e['apply'](_0x5314d2,_0x55e2a6||[]))['next']());});};class ListService{constructor(_0x75d93b){this['fetch']=_0x75d93b;}['add'](_0x445e86,_0x2afc9d,_0x43e7c0){return __awaiter$2(this,void 0,void 0,function*(){const _0x1969da='List',_0x45e15b={'account_name':_0x445e86,'list_name':_0x2afc9d};try{const _0x42ec23=yield this['fetch']['post'](_0x1969da,_0x43e7c0,_0x45e15b);if(_0x42ec23['status']>0xc7&&_0x42ec23['status']<0x12c){const _0x4f0baf=yield _0x42ec23['json']();return new SuccessfulAccountResponse(_0x4f0baf);}const _0x3d43d5=yield _0x42ec23['json']();return new FailedAccountResponse(_0x3d43d5);}catch(_0x464b0e){if(_0x464b0e instanceof Error)return new FailedAccountResponse({'detail':_0x464b0e['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x464b0e;}});}['remove'](_0x23e7cd,_0x47ffbd,_0x1088e1){return __awaiter$2(this,void 0,void 0,function*(){const _0x5e3404='List/'+_0x23e7cd+'/'+_0x47ffbd,_0x4c70d5=yield this['fetch']['delete'](_0x5e3404,_0x1088e1);try{if(_0x4c70d5['status']>0xc7&&_0x4c70d5['status']<0x12c){const _0x10a01a=yield _0x4c70d5['json']();return new SuccessfulAccountResponse(_0x10a01a);}const _0x2f4f80=yield _0x4c70d5['json']();return new FailedAccountResponse(_0x2f4f80);}catch(_0x11603b){if(_0x11603b instanceof Error)return new FailedAccountResponse({'detail':_0x11603b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x11603b;}});}}
|
|
10
|
+
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xcf0452,_0x255c0a,_0x5467ff,_0x1d0cce){function _0x3d3e5c(_0x4bedcf){return _0x4bedcf instanceof _0x5467ff?_0x4bedcf:new _0x5467ff(function(_0x10d891){_0x10d891(_0x4bedcf);});}return new(_0x5467ff||(_0x5467ff=Promise))(function(_0x4b8679,_0x548eb9){function _0x4f86b1(_0x41bfc6){try{_0xde5367(_0x1d0cce['next'](_0x41bfc6));}catch(_0x42c8ab){_0x548eb9(_0x42c8ab);}}function _0x6feb0a(_0x1fb389){try{_0xde5367(_0x1d0cce['throw'](_0x1fb389));}catch(_0x24881e){_0x548eb9(_0x24881e);}}function _0xde5367(_0x3528c3){_0x3528c3['done']?_0x4b8679(_0x3528c3['value']):_0x3d3e5c(_0x3528c3['value'])['then'](_0x4f86b1,_0x6feb0a);}_0xde5367((_0x1d0cce=_0x1d0cce['apply'](_0xcf0452,_0x255c0a||[]))['next']());});};class Fetch{constructor(_0x168c02){this['baseUri']=_0x168c02,this['getUrl']=_0x1df9fc=>{return _0x1df9fc['startsWith']('/')&&(_0x1df9fc=_0x1df9fc['replace']('/','')),''+this['baseUri']+_0x1df9fc;},!_0x168c02['endsWith']('/')&&(_0x168c02=_0x168c02+'/');}['get'](_0x47c117,_0x6ad76){return __awaiter$1(this,void 0,void 0,function*(){const _0x1bc682=this['getUrl'](_0x47c117);return yield fetch(_0x1bc682,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x6ad76}});});}['post'](_0x11346d,_0x228281,_0x4d8f30){return __awaiter$1(this,void 0,void 0,function*(){const _0x138dc5=this['getUrl'](_0x11346d);return yield fetch(_0x138dc5,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x228281},'body':_0x4d8f30?JSON['stringify'](_0x4d8f30):null});});}['put'](_0x1af94e,_0x20a18b,_0x409770){return __awaiter$1(this,void 0,void 0,function*(){const _0x5a85b4=this['getUrl'](_0x1af94e);return yield fetch(_0x5a85b4,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x20a18b},'body':_0x409770?JSON['stringify'](_0x409770):null});});}['delete'](_0x30f8d4,_0x2f63c3){return __awaiter$1(this,void 0,void 0,function*(){const _0x3d943b=this['getUrl'](_0x30f8d4);return yield fetch(_0x3d943b,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2f63c3}});});}}
|
|
12
|
+
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x4f4f17,_0x5a3e3d,_0x3afe3f,_0x2bf4c4){function _0x268e0e(_0x49efe3){return _0x49efe3 instanceof _0x3afe3f?_0x49efe3:new _0x3afe3f(function(_0x3e1ff7){_0x3e1ff7(_0x49efe3);});}return new(_0x3afe3f||(_0x3afe3f=Promise))(function(_0x4f0430,_0x550417){function _0x51312b(_0x4d5dd2){try{_0xfbcc64(_0x2bf4c4['next'](_0x4d5dd2));}catch(_0x1355bb){_0x550417(_0x1355bb);}}function _0x570c7d(_0x4a0083){try{_0xfbcc64(_0x2bf4c4['throw'](_0x4a0083));}catch(_0x327c1d){_0x550417(_0x327c1d);}}function _0xfbcc64(_0x4ee5f4){_0x4ee5f4['done']?_0x4f0430(_0x4ee5f4['value']):_0x268e0e(_0x4ee5f4['value'])['then'](_0x51312b,_0x570c7d);}_0xfbcc64((_0x2bf4c4=_0x2bf4c4['apply'](_0x4f4f17,_0x5a3e3d||[]))['next']());});};class AdminClient{constructor(_0x377ad8='https://admin.searchability.dev/'){var _0x175705=new Fetch(_0x377ad8);this['Accounts']=new AccountService(_0x175705),this['Lists']=new ListService(_0x175705),this['ApiKeys']=new ApiKeyService(_0x175705);}}class AuthClient{constructor(_0x18e197='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x18e197);}['login'](_0x236d5b){return __awaiter(this,void 0,void 0,function*(){var _0x513980='login/'+_0x236d5b;try{const _0x2f7814=yield yield fetch(_0x513980);if(_0x2f7814['status']>0xc7&&_0x2f7814['status']<0x12c){const _0x4d9660=yield _0x2f7814['json']();return new SuccessfulAuthResponse(_0x4d9660);}const _0x4f4578=yield _0x2f7814['json']();return new FailedAuthResponse(_0x4f4578);}catch(_0x27f053){if(_0x27f053 instanceof Error)return new FailedAuthResponse({'detail':_0x27f053['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x27f053;}});}['refresh'](_0x34e89d){return __awaiter(this,void 0,void 0,function*(){var _0x5dd95d='refresh';try{const _0x2fd895=yield this['fetch']['post'](_0x5dd95d,_0x34e89d,null);if(_0x2fd895['status']>0xc7&&_0x2fd895['status']<0x12c){const _0x48c893=yield _0x2fd895['json']();return new SuccessfulAuthResponse(_0x48c893);}const _0x535376=yield _0x2fd895['json']();return new FailedAuthResponse(_0x535376);}catch(_0x5a6216){if(_0x5a6216 instanceof Error)return new FailedAuthResponse({'detail':_0x5a6216['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5a6216;}});}}
|
|
14
|
+
|
|
15
|
+
export { AdminClient, AuthClient };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
undefined&&undefined['__awaiter']||function(
|
|
3
|
+
undefined&&undefined['__awaiter']||function(_0x315a9e,_0xe24ed2,_0xbacc9,_0x214989){function _0x59cb70(_0x3e5a52){return _0x3e5a52 instanceof _0xbacc9?_0x3e5a52:new _0xbacc9(function(_0x375fce){_0x375fce(_0x3e5a52);});}return new(_0xbacc9||(_0xbacc9=Promise))(function(_0x135fa0,_0x553a32){function _0x5db6ed(_0x30f8d9){try{_0x25b5aa(_0x214989['next'](_0x30f8d9));}catch(_0x52ab1f){_0x553a32(_0x52ab1f);}}function _0x18f595(_0x58c48f){try{_0x25b5aa(_0x214989['throw'](_0x58c48f));}catch(_0x297239){_0x553a32(_0x297239);}}function _0x25b5aa(_0x119b78){_0x119b78['done']?_0x135fa0(_0x119b78['value']):_0x59cb70(_0x119b78['value'])['then'](_0x5db6ed,_0x18f595);}_0x25b5aa((_0x214989=_0x214989['apply'](_0x315a9e,_0xe24ed2||[]))['next']());});};
|
|
4
4
|
|
|
5
|
-
class Response{constructor(
|
|
5
|
+
class Response{constructor(_0x4755bf){this['isSuccess']=_0x4755bf;}}class SuccessfulAccountResponse extends Response{constructor(_0xa205db){super(!![]),this['account']=_0xa205db;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xcac449){super(![]),this['problem']=_0xcac449;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x1b3d02){super(!![]),this['tokens']=_0x1b3d02;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x1e2db2){super(![]),this['problem']=_0x1e2db2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x5144f4){super(!![]),this['apiKeys']=_0x5144f4;}['toSuccess'](){return this['apiKeys'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x8dd2be){super(![]),this['problem']=_0x8dd2be;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x531c8f,_0x3695b7,_0x5b3c48,_0x3e3b93){function _0x38a47d(_0x34e610){return _0x34e610 instanceof _0x5b3c48?_0x34e610:new _0x5b3c48(function(_0x2306e2){_0x2306e2(_0x34e610);});}return new(_0x5b3c48||(_0x5b3c48=Promise))(function(_0x4950c1,_0x616cc8){function _0x25a27d(_0x3a22de){try{_0x227918(_0x3e3b93['next'](_0x3a22de));}catch(_0x20f1f7){_0x616cc8(_0x20f1f7);}}function _0x47b968(_0x2de341){try{_0x227918(_0x3e3b93['throw'](_0x2de341));}catch(_0x114eae){_0x616cc8(_0x114eae);}}function _0x227918(_0x187c42){_0x187c42['done']?_0x4950c1(_0x187c42['value']):_0x38a47d(_0x187c42['value'])['then'](_0x25a27d,_0x47b968);}_0x227918((_0x3e3b93=_0x3e3b93['apply'](_0x531c8f,_0x3695b7||[]))['next']());});};class AccountService{constructor(_0x280191){this['fetch']=_0x280191;}['get'](_0x5005ca,_0x264537){return __awaiter$4(this,void 0,void 0,function*(){const _0x1b4a8c='Account/'+_0x5005ca+'/',_0x15401f=yield this['fetch']['get'](_0x1b4a8c,_0x264537);try{if(_0x15401f['status']>0xc7&&_0x15401f['status']<0x12c){const _0x539838=yield _0x15401f['json']();return new SuccessfulAccountResponse(_0x539838);}const _0x27c998=yield _0x15401f['json']();return new FailedAccountResponse(_0x27c998);}catch(_0x331ea8){if(_0x331ea8 instanceof Error)return new FailedAccountResponse({'detail':_0x331ea8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x331ea8;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x6ff6e6,_0x2eca36,_0x4d7c3c,_0x4c0fff){function _0x12f909(_0x4e2667){return _0x4e2667 instanceof _0x4d7c3c?_0x4e2667:new _0x4d7c3c(function(_0x54af6a){_0x54af6a(_0x4e2667);});}return new(_0x4d7c3c||(_0x4d7c3c=Promise))(function(_0x44d986,_0x589ed3){function _0xd6088e(_0x1eb9c3){try{_0x47c73b(_0x4c0fff['next'](_0x1eb9c3));}catch(_0x2ac3e9){_0x589ed3(_0x2ac3e9);}}function _0x168b81(_0x416fad){try{_0x47c73b(_0x4c0fff['throw'](_0x416fad));}catch(_0x22ae52){_0x589ed3(_0x22ae52);}}function _0x47c73b(_0x572af1){_0x572af1['done']?_0x44d986(_0x572af1['value']):_0x12f909(_0x572af1['value'])['then'](_0xd6088e,_0x168b81);}_0x47c73b((_0x4c0fff=_0x4c0fff['apply'](_0x6ff6e6,_0x2eca36||[]))['next']());});};class ApiKeyService{constructor(_0xd55e7e){this['fetch']=_0xd55e7e;}['create'](_0x24f7d6,_0x5dcbeb,_0x426c89){return __awaiter$3(this,void 0,void 0,function*(){const _0x701fa4='ApiKey/Create',_0x317325={'account_name':_0x24f7d6,'name':_0x5dcbeb};try{const _0x30ac88=yield this['fetch']['post'](_0x701fa4,_0x426c89,_0x317325);if(_0x30ac88['status']>0xc7&&_0x30ac88['status']<0x12c){const _0x3cafa7=yield _0x30ac88['json']();return new SuccessfulApiKeyResponse(_0x3cafa7);}const _0x9f540b=yield _0x30ac88['json']();return new FailedApiKeyResponse(_0x9f540b);}catch(_0x13fbe5){if(_0x13fbe5 instanceof Error)return new FailedApiKeyResponse({'detail':_0x13fbe5['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x13fbe5;}});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x1e890b,_0x2c7cfd,_0x2dcac4,_0x290195){function _0x29f073(_0x4b66ef){return _0x4b66ef instanceof _0x2dcac4?_0x4b66ef:new _0x2dcac4(function(_0xe617db){_0xe617db(_0x4b66ef);});}return new(_0x2dcac4||(_0x2dcac4=Promise))(function(_0x154f8b,_0x2e1ccb){function _0x3d972a(_0x1e3e4a){try{_0x249bd6(_0x290195['next'](_0x1e3e4a));}catch(_0x5bbedd){_0x2e1ccb(_0x5bbedd);}}function _0x1c5c81(_0x15cbc1){try{_0x249bd6(_0x290195['throw'](_0x15cbc1));}catch(_0x32932f){_0x2e1ccb(_0x32932f);}}function _0x249bd6(_0x1ba01f){_0x1ba01f['done']?_0x154f8b(_0x1ba01f['value']):_0x29f073(_0x1ba01f['value'])['then'](_0x3d972a,_0x1c5c81);}_0x249bd6((_0x290195=_0x290195['apply'](_0x1e890b,_0x2c7cfd||[]))['next']());});};class ListService{constructor(_0x203d67){this['fetch']=_0x203d67;}['add'](_0x3fb2c9,_0x1c1de2,_0x3c3708){return __awaiter$2(this,void 0,void 0,function*(){const _0x198887='List',_0x2c3b62={'account_name':_0x3fb2c9,'list_name':_0x1c1de2};try{const _0x407c69=yield this['fetch']['post'](_0x198887,_0x3c3708,_0x2c3b62);if(_0x407c69['status']>0xc7&&_0x407c69['status']<0x12c){const _0x35f49d=yield _0x407c69['json']();return new SuccessfulAccountResponse(_0x35f49d);}const _0xd83fee=yield _0x407c69['json']();return new FailedAccountResponse(_0xd83fee);}catch(_0x9bd929){if(_0x9bd929 instanceof Error)return new FailedAccountResponse({'detail':_0x9bd929['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x9bd929;}});}['remove'](_0x3a3f47,_0x1b534c,_0x52e782){return __awaiter$2(this,void 0,void 0,function*(){const _0x5c7f44='List/'+_0x3a3f47+'/'+_0x1b534c,_0x3ad30b=yield this['fetch']['delete'](_0x5c7f44,_0x52e782);try{if(_0x3ad30b['status']>0xc7&&_0x3ad30b['status']<0x12c){const _0x1875db=yield _0x3ad30b['json']();return new SuccessfulAccountResponse(_0x1875db);}const _0xeb2dda=yield _0x3ad30b['json']();return new FailedAccountResponse(_0xeb2dda);}catch(_0x4b67f5){if(_0x4b67f5 instanceof Error)return new FailedAccountResponse({'detail':_0x4b67f5['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4b67f5;}});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x28e58d,_0x1eaad1,_0x367e6e,_0xeb3f66){function _0x1c89f5(_0x42bb65){return _0x42bb65 instanceof _0x367e6e?_0x42bb65:new _0x367e6e(function(_0xf00699){_0xf00699(_0x42bb65);});}return new(_0x367e6e||(_0x367e6e=Promise))(function(_0x13dd29,_0x408c3e){function _0x58e38f(_0x126bb7){try{_0x2cabad(_0xeb3f66['next'](_0x126bb7));}catch(_0x5b4ada){_0x408c3e(_0x5b4ada);}}function _0x3ec983(_0x34a555){try{_0x2cabad(_0xeb3f66['throw'](_0x34a555));}catch(_0x12ccde){_0x408c3e(_0x12ccde);}}function _0x2cabad(_0x1ba10a){_0x1ba10a['done']?_0x13dd29(_0x1ba10a['value']):_0x1c89f5(_0x1ba10a['value'])['then'](_0x58e38f,_0x3ec983);}_0x2cabad((_0xeb3f66=_0xeb3f66['apply'](_0x28e58d,_0x1eaad1||[]))['next']());});};class Fetch{constructor(_0x44ef85){this['baseUri']=_0x44ef85,this['getUrl']=_0x29ed82=>{return _0x29ed82['startsWith']('/')&&(_0x29ed82=_0x29ed82['replace']('/','')),''+this['baseUri']+_0x29ed82;},!_0x44ef85['endsWith']('/')&&(_0x44ef85=_0x44ef85+'/');}['get'](_0x46745b,_0x2fea04){return __awaiter$1(this,void 0,void 0,function*(){const _0x453328=this['getUrl'](_0x46745b);return yield fetch(_0x453328,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2fea04}});});}['post'](_0x8b1dc9,_0x341676,_0x217a89){return __awaiter$1(this,void 0,void 0,function*(){const _0x49a70b=this['getUrl'](_0x8b1dc9);return yield fetch(_0x49a70b,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x341676},'body':_0x217a89?JSON['stringify'](_0x217a89):null});});}['put'](_0x5ecb04,_0x3b6229,_0x2ceaed){return __awaiter$1(this,void 0,void 0,function*(){const _0x34b741=this['getUrl'](_0x5ecb04);return yield fetch(_0x34b741,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3b6229},'body':_0x2ceaed?JSON['stringify'](_0x2ceaed):null});});}['delete'](_0x59b355,_0x2edcc6){return __awaiter$1(this,void 0,void 0,function*(){const _0x5f041f=this['getUrl'](_0x59b355);return yield fetch(_0x5f041f,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2edcc6}});});}}
|
|
14
14
|
|
|
15
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
15
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x56f4d9,_0x54688b,_0x1ba473,_0x15a163){function _0x52d117(_0x209870){return _0x209870 instanceof _0x1ba473?_0x209870:new _0x1ba473(function(_0x471b7c){_0x471b7c(_0x209870);});}return new(_0x1ba473||(_0x1ba473=Promise))(function(_0x429e14,_0x84fcef){function _0x2b0cc3(_0x30593b){try{_0xb793ea(_0x15a163['next'](_0x30593b));}catch(_0xdbee04){_0x84fcef(_0xdbee04);}}function _0x3127bc(_0xb19c86){try{_0xb793ea(_0x15a163['throw'](_0xb19c86));}catch(_0x369fb9){_0x84fcef(_0x369fb9);}}function _0xb793ea(_0xbe6b1f){_0xbe6b1f['done']?_0x429e14(_0xbe6b1f['value']):_0x52d117(_0xbe6b1f['value'])['then'](_0x2b0cc3,_0x3127bc);}_0xb793ea((_0x15a163=_0x15a163['apply'](_0x56f4d9,_0x54688b||[]))['next']());});};class AdminClient{constructor(_0x43503a='https://admin.searchability.dev/'){var _0x4916e5=new Fetch(_0x43503a);this['Accounts']=new AccountService(_0x4916e5),this['Lists']=new ListService(_0x4916e5),this['ApiKeys']=new ApiKeyService(_0x4916e5);}}class AuthClient{constructor(_0x1f84bd='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1f84bd);}['login'](_0xe598d4){return __awaiter(this,void 0,void 0,function*(){var _0x5396d5='login/'+_0xe598d4;try{const _0x415759=yield yield fetch(_0x5396d5);if(_0x415759['status']>0xc7&&_0x415759['status']<0x12c){const _0x312088=yield _0x415759['json']();return new SuccessfulAuthResponse(_0x312088);}const _0x1f72ae=yield _0x415759['json']();return new FailedAuthResponse(_0x1f72ae);}catch(_0xe9beb1){if(_0xe9beb1 instanceof Error)return new FailedAuthResponse({'detail':_0xe9beb1['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xe9beb1;}});}['refresh'](_0xd7e5de){return __awaiter(this,void 0,void 0,function*(){var _0x16201a='refresh';try{const _0x39edc0=yield this['fetch']['post'](_0x16201a,_0xd7e5de,null);if(_0x39edc0['status']>0xc7&&_0x39edc0['status']<0x12c){const _0x257ea6=yield _0x39edc0['json']();return new SuccessfulAuthResponse(_0x257ea6);}const _0xf1dbd1=yield _0x39edc0['json']();return new FailedAuthResponse(_0xf1dbd1);}catch(_0x2caf9c){if(_0x2caf9c instanceof Error)return new FailedAuthResponse({'detail':_0x2caf9c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2caf9c;}});}}
|
|
16
16
|
|
|
17
17
|
exports.AdminClient = AdminClient;
|
|
18
18
|
exports.AuthClient = AuthClient;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
undefined&&undefined['__awaiter']||function(
|
|
1
|
+
undefined&&undefined['__awaiter']||function(_0x2d2f47,_0x449cb9,_0x5ba582,_0x268e38){function _0xa49de0(_0x532107){return _0x532107 instanceof _0x5ba582?_0x532107:new _0x5ba582(function(_0xa229fe){_0xa229fe(_0x532107);});}return new(_0x5ba582||(_0x5ba582=Promise))(function(_0x3cef02,_0x34701e){function _0x2ef134(_0x93baf7){try{_0x31f1fa(_0x268e38['next'](_0x93baf7));}catch(_0x3b38f7){_0x34701e(_0x3b38f7);}}function _0x4c6580(_0x163e0a){try{_0x31f1fa(_0x268e38['throw'](_0x163e0a));}catch(_0x3ca3f1){_0x34701e(_0x3ca3f1);}}function _0x31f1fa(_0x5da5bf){_0x5da5bf['done']?_0x3cef02(_0x5da5bf['value']):_0xa49de0(_0x5da5bf['value'])['then'](_0x2ef134,_0x4c6580);}_0x31f1fa((_0x268e38=_0x268e38['apply'](_0x2d2f47,_0x449cb9||[]))['next']());});};
|
|
2
2
|
|
|
3
|
-
class Response{constructor(
|
|
3
|
+
class Response{constructor(_0x1f1ed3){this['isSuccess']=_0x1f1ed3;}}class SuccessfulAccountResponse extends Response{constructor(_0x58b922){super(!![]),this['account']=_0x58b922;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x13dae7){super(![]),this['problem']=_0x13dae7;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4418e3){super(!![]),this['tokens']=_0x4418e3;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x1b0c30){super(![]),this['problem']=_0x1b0c30;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x363a15){super(!![]),this['apiKeys']=_0x363a15;}['toSuccess'](){return this['apiKeys'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x2b90bd){super(![]),this['problem']=_0x2b90bd;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0xba8c58,_0x329163,_0x38c56d,_0x30239f){function _0x3eb280(_0x27c0b7){return _0x27c0b7 instanceof _0x38c56d?_0x27c0b7:new _0x38c56d(function(_0x542748){_0x542748(_0x27c0b7);});}return new(_0x38c56d||(_0x38c56d=Promise))(function(_0x10b0b3,_0x214b11){function _0x104a75(_0x428082){try{_0x266beb(_0x30239f['next'](_0x428082));}catch(_0x3fe783){_0x214b11(_0x3fe783);}}function _0x55c979(_0x2f6179){try{_0x266beb(_0x30239f['throw'](_0x2f6179));}catch(_0x7f30d5){_0x214b11(_0x7f30d5);}}function _0x266beb(_0x160638){_0x160638['done']?_0x10b0b3(_0x160638['value']):_0x3eb280(_0x160638['value'])['then'](_0x104a75,_0x55c979);}_0x266beb((_0x30239f=_0x30239f['apply'](_0xba8c58,_0x329163||[]))['next']());});};class AccountService{constructor(_0x597b2d){this['fetch']=_0x597b2d;}['get'](_0x1cb780,_0x39a285){return __awaiter$4(this,void 0,void 0,function*(){const _0x1b00ab='Account/'+_0x1cb780+'/',_0x498558=yield this['fetch']['get'](_0x1b00ab,_0x39a285);try{if(_0x498558['status']>0xc7&&_0x498558['status']<0x12c){const _0x3416b6=yield _0x498558['json']();return new SuccessfulAccountResponse(_0x3416b6);}const _0x3ebacb=yield _0x498558['json']();return new FailedAccountResponse(_0x3ebacb);}catch(_0x150ee7){if(_0x150ee7 instanceof Error)return new FailedAccountResponse({'detail':_0x150ee7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x150ee7;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0xfac54,_0x634d0,_0x2e2de1,_0x28b250){function _0x48b538(_0x1f6b45){return _0x1f6b45 instanceof _0x2e2de1?_0x1f6b45:new _0x2e2de1(function(_0x2eca98){_0x2eca98(_0x1f6b45);});}return new(_0x2e2de1||(_0x2e2de1=Promise))(function(_0x2e6d7c,_0x37fc65){function _0x4f32b8(_0x18428a){try{_0x661e4b(_0x28b250['next'](_0x18428a));}catch(_0x40a3c4){_0x37fc65(_0x40a3c4);}}function _0x27fe89(_0x26c23c){try{_0x661e4b(_0x28b250['throw'](_0x26c23c));}catch(_0x5c4de1){_0x37fc65(_0x5c4de1);}}function _0x661e4b(_0x5c28b){_0x5c28b['done']?_0x2e6d7c(_0x5c28b['value']):_0x48b538(_0x5c28b['value'])['then'](_0x4f32b8,_0x27fe89);}_0x661e4b((_0x28b250=_0x28b250['apply'](_0xfac54,_0x634d0||[]))['next']());});};class ApiKeyService{constructor(_0x3d8460){this['fetch']=_0x3d8460;}['create'](_0x63dcad,_0x2d4668,_0x5d4955){return __awaiter$3(this,void 0,void 0,function*(){const _0x1fd46c='ApiKey/Create',_0x50d860={'account_name':_0x63dcad,'name':_0x2d4668};try{const _0x259b9b=yield this['fetch']['post'](_0x1fd46c,_0x5d4955,_0x50d860);if(_0x259b9b['status']>0xc7&&_0x259b9b['status']<0x12c){const _0xbf2e62=yield _0x259b9b['json']();return new SuccessfulApiKeyResponse(_0xbf2e62);}const _0xf50cd3=yield _0x259b9b['json']();return new FailedApiKeyResponse(_0xf50cd3);}catch(_0x3a4cc2){if(_0x3a4cc2 instanceof Error)return new FailedApiKeyResponse({'detail':_0x3a4cc2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3a4cc2;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4961c6,_0x512808,_0x430d07,_0x3f0266){function _0x40a25b(_0x539ecd){return _0x539ecd instanceof _0x430d07?_0x539ecd:new _0x430d07(function(_0x1bcbf4){_0x1bcbf4(_0x539ecd);});}return new(_0x430d07||(_0x430d07=Promise))(function(_0x3d60b7,_0x386fb6){function _0x533d9f(_0x506a95){try{_0x444110(_0x3f0266['next'](_0x506a95));}catch(_0x30681c){_0x386fb6(_0x30681c);}}function _0xd5bbf5(_0x1c3742){try{_0x444110(_0x3f0266['throw'](_0x1c3742));}catch(_0x305391){_0x386fb6(_0x305391);}}function _0x444110(_0xc67b80){_0xc67b80['done']?_0x3d60b7(_0xc67b80['value']):_0x40a25b(_0xc67b80['value'])['then'](_0x533d9f,_0xd5bbf5);}_0x444110((_0x3f0266=_0x3f0266['apply'](_0x4961c6,_0x512808||[]))['next']());});};class ListService{constructor(_0xf18b3){this['fetch']=_0xf18b3;}['add'](_0x2d0644,_0x5c2352,_0x344227){return __awaiter$2(this,void 0,void 0,function*(){const _0x360615='List',_0x371af6={'account_name':_0x2d0644,'list_name':_0x5c2352};try{const _0x172219=yield this['fetch']['post'](_0x360615,_0x344227,_0x371af6);if(_0x172219['status']>0xc7&&_0x172219['status']<0x12c){const _0x19ede9=yield _0x172219['json']();return new SuccessfulAccountResponse(_0x19ede9);}const _0x1770f4=yield _0x172219['json']();return new FailedAccountResponse(_0x1770f4);}catch(_0x42ccc0){if(_0x42ccc0 instanceof Error)return new FailedAccountResponse({'detail':_0x42ccc0['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x42ccc0;}});}['remove'](_0x70e96b,_0x43a1e2,_0x3921e9){return __awaiter$2(this,void 0,void 0,function*(){const _0x224425='List/'+_0x70e96b+'/'+_0x43a1e2,_0x4f6881=yield this['fetch']['delete'](_0x224425,_0x3921e9);try{if(_0x4f6881['status']>0xc7&&_0x4f6881['status']<0x12c){const _0x2998ba=yield _0x4f6881['json']();return new SuccessfulAccountResponse(_0x2998ba);}const _0x2994e8=yield _0x4f6881['json']();return new FailedAccountResponse(_0x2994e8);}catch(_0xccfecf){if(_0xccfecf instanceof Error)return new FailedAccountResponse({'detail':_0xccfecf['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xccfecf;}});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x4a6fe5,_0x2d182d,_0x224e69,_0x5a339e){function _0x46abf7(_0x27498f){return _0x27498f instanceof _0x224e69?_0x27498f:new _0x224e69(function(_0x468ca7){_0x468ca7(_0x27498f);});}return new(_0x224e69||(_0x224e69=Promise))(function(_0x620a16,_0xffe0df){function _0x49703b(_0x3c743e){try{_0x4fd57f(_0x5a339e['next'](_0x3c743e));}catch(_0x1faf5e){_0xffe0df(_0x1faf5e);}}function _0x25bc5a(_0x358d1c){try{_0x4fd57f(_0x5a339e['throw'](_0x358d1c));}catch(_0x16dbc1){_0xffe0df(_0x16dbc1);}}function _0x4fd57f(_0x3b5496){_0x3b5496['done']?_0x620a16(_0x3b5496['value']):_0x46abf7(_0x3b5496['value'])['then'](_0x49703b,_0x25bc5a);}_0x4fd57f((_0x5a339e=_0x5a339e['apply'](_0x4a6fe5,_0x2d182d||[]))['next']());});};class Fetch{constructor(_0x146403){this['baseUri']=_0x146403,this['getUrl']=_0x3d8df4=>{return _0x3d8df4['startsWith']('/')&&(_0x3d8df4=_0x3d8df4['replace']('/','')),''+this['baseUri']+_0x3d8df4;},!_0x146403['endsWith']('/')&&(_0x146403=_0x146403+'/');}['get'](_0x38a34f,_0x4e0087){return __awaiter$1(this,void 0,void 0,function*(){const _0x9f1a9a=this['getUrl'](_0x38a34f);return yield fetch(_0x9f1a9a,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4e0087}});});}['post'](_0x357ee1,_0x397d15,_0x2782cc){return __awaiter$1(this,void 0,void 0,function*(){const _0x7dbd29=this['getUrl'](_0x357ee1);return yield fetch(_0x7dbd29,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x397d15},'body':_0x2782cc?JSON['stringify'](_0x2782cc):null});});}['put'](_0x4eadbb,_0x517773,_0x48272){return __awaiter$1(this,void 0,void 0,function*(){const _0x4ca6df=this['getUrl'](_0x4eadbb);return yield fetch(_0x4ca6df,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x517773},'body':_0x48272?JSON['stringify'](_0x48272):null});});}['delete'](_0x3db2e6,_0x35523a){return __awaiter$1(this,void 0,void 0,function*(){const _0x28e4a6=this['getUrl'](_0x3db2e6);return yield fetch(_0x28e4a6,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x35523a}});});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x99c8e,_0x25af06,_0x2ad405,_0x3243ab){function _0x441787(_0x23b52c){return _0x23b52c instanceof _0x2ad405?_0x23b52c:new _0x2ad405(function(_0x58ad76){_0x58ad76(_0x23b52c);});}return new(_0x2ad405||(_0x2ad405=Promise))(function(_0x34de23,_0x98d354){function _0x3246dc(_0x2e5a46){try{_0x58f4d0(_0x3243ab['next'](_0x2e5a46));}catch(_0x2405e8){_0x98d354(_0x2405e8);}}function _0x3997f3(_0x585014){try{_0x58f4d0(_0x3243ab['throw'](_0x585014));}catch(_0x1e448d){_0x98d354(_0x1e448d);}}function _0x58f4d0(_0x3017b9){_0x3017b9['done']?_0x34de23(_0x3017b9['value']):_0x441787(_0x3017b9['value'])['then'](_0x3246dc,_0x3997f3);}_0x58f4d0((_0x3243ab=_0x3243ab['apply'](_0x99c8e,_0x25af06||[]))['next']());});};class AdminClient{constructor(_0x183679='https://admin.searchability.dev/'){var _0x3dc087=new Fetch(_0x183679);this['Accounts']=new AccountService(_0x3dc087),this['Lists']=new ListService(_0x3dc087),this['ApiKeys']=new ApiKeyService(_0x3dc087);}}class AuthClient{constructor(_0x4ab1e2='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x4ab1e2);}['login'](_0x452586){return __awaiter(this,void 0,void 0,function*(){var _0x5472a8='login/'+_0x452586;try{const _0x21bb8e=yield yield fetch(_0x5472a8);if(_0x21bb8e['status']>0xc7&&_0x21bb8e['status']<0x12c){const _0x516066=yield _0x21bb8e['json']();return new SuccessfulAuthResponse(_0x516066);}const _0x353965=yield _0x21bb8e['json']();return new FailedAuthResponse(_0x353965);}catch(_0x14ddd7){if(_0x14ddd7 instanceof Error)return new FailedAuthResponse({'detail':_0x14ddd7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x14ddd7;}});}['refresh'](_0x4eb4b0){return __awaiter(this,void 0,void 0,function*(){var _0x15eb2a='refresh';try{const _0x912d4b=yield this['fetch']['post'](_0x15eb2a,_0x4eb4b0,null);if(_0x912d4b['status']>0xc7&&_0x912d4b['status']<0x12c){const _0x2af908=yield _0x912d4b['json']();return new SuccessfulAuthResponse(_0x2af908);}const _0x485c44=yield _0x912d4b['json']();return new FailedAuthResponse(_0x485c44);}catch(_0x2bcff2){if(_0x2bcff2 instanceof Error)return new FailedAuthResponse({'detail':_0x2bcff2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2bcff2;}});}}
|
|
14
14
|
|
|
15
15
|
export { AdminClient, AuthClient };
|
package/dist/types.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ declare class AuthClient {
|
|
|
40
40
|
refresh(refreshToken: string): Promise<Response<Tokens, Problem>>;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
declare class TokenManager {
|
|
44
|
+
readonly authClient: AuthClient;
|
|
45
|
+
constructor(authClient: AuthClient);
|
|
46
|
+
getOrRefreshTokens(tokens: Tokens): Promise<Response<Tokens, Problem>>;
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
declare abstract class Response<S, F> {
|
|
44
50
|
readonly isSuccess: boolean;
|
|
45
51
|
constructor(isSuccess: boolean);
|
|
@@ -122,4 +128,4 @@ declare class FailedApiKeyResponse extends Response<ApiKey[], Problem> {
|
|
|
122
128
|
toProblem(): Problem;
|
|
123
129
|
}
|
|
124
130
|
|
|
125
|
-
export { type Account, AdminClient, type ApiKey, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, type Tokens };
|
|
131
|
+
export { type Account, AdminClient, type ApiKey, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, TokenManager, type Tokens };
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
undefined&&undefined['__awaiter']||function(_0x5752fa,_0x11668b,_0x5d6697,_0x4716de){function _0x26f552(_0x51e87e){return _0x51e87e instanceof _0x5d6697?_0x51e87e:new _0x5d6697(function(_0x40c70e){_0x40c70e(_0x51e87e);});}return new(_0x5d6697||(_0x5d6697=Promise))(function(_0x4d24a8,_0x197e2d){function _0x24355f(_0x524591){try{_0x296b5b(_0x4716de['next'](_0x524591));}catch(_0x3c6680){_0x197e2d(_0x3c6680);}}function _0x1d5d38(_0x53b635){try{_0x296b5b(_0x4716de['throw'](_0x53b635));}catch(_0x550e80){_0x197e2d(_0x550e80);}}function _0x296b5b(_0xb960b9){_0xb960b9['done']?_0x4d24a8(_0xb960b9['value']):_0x26f552(_0xb960b9['value'])['then'](_0x24355f,_0x1d5d38);}_0x296b5b((_0x4716de=_0x4716de['apply'](_0x5752fa,_0x11668b||[]))['next']());});};
|
|
2
|
-
|
|
3
|
-
class Response{constructor(_0x4cd842){this['isSuccess']=_0x4cd842;}}class SuccessfulAccountResponse extends Response{constructor(_0x3c979a){super(!![]),this['account']=_0x3c979a;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2542b4){super(![]),this['problem']=_0x2542b4;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x214b3f){super(!![]),this['tokens']=_0x214b3f;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x40acd9){super(![]),this['problem']=_0x40acd9;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x414f35){super(!![]),this['apiKeys']=_0x414f35;}['toSuccess'](){return this['apiKeys'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x5f8d5d){super(![]),this['problem']=_0x5f8d5d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
|
-
|
|
5
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x10c32f,_0x5a703f,_0x5ac711,_0x3721c9){function _0x547941(_0x36a478){return _0x36a478 instanceof _0x5ac711?_0x36a478:new _0x5ac711(function(_0x534d13){_0x534d13(_0x36a478);});}return new(_0x5ac711||(_0x5ac711=Promise))(function(_0x47072d,_0x2c96bd){function _0x4d00d7(_0x2432d3){try{_0xc02bf6(_0x3721c9['next'](_0x2432d3));}catch(_0x268f9f){_0x2c96bd(_0x268f9f);}}function _0x322f09(_0x774371){try{_0xc02bf6(_0x3721c9['throw'](_0x774371));}catch(_0x411e2c){_0x2c96bd(_0x411e2c);}}function _0xc02bf6(_0x4cab66){_0x4cab66['done']?_0x47072d(_0x4cab66['value']):_0x547941(_0x4cab66['value'])['then'](_0x4d00d7,_0x322f09);}_0xc02bf6((_0x3721c9=_0x3721c9['apply'](_0x10c32f,_0x5a703f||[]))['next']());});};class AccountService{constructor(_0x4dadc6){this['fetch']=_0x4dadc6;}['get'](_0x45686c,_0x31ceb7){return __awaiter$4(this,void 0,void 0,function*(){const _0x438504='Account/'+_0x45686c+'/',_0x4af386=yield this['fetch']['get'](_0x438504,_0x31ceb7);try{if(_0x4af386['status']>0xc7&&_0x4af386['status']<0x12c){const _0x329ff2=yield _0x4af386['json']();return new SuccessfulAccountResponse(_0x329ff2);}const _0x1ea9f9=yield _0x4af386['json']();return new FailedAccountResponse(_0x1ea9f9);}catch(_0x5e66ef){if(_0x5e66ef instanceof Error)return new FailedAccountResponse({'detail':_0x5e66ef['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5e66ef;}});}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x493fbf,_0x2b3a8e,_0x532e4d,_0x3ab447){function _0x5e40ee(_0x56d398){return _0x56d398 instanceof _0x532e4d?_0x56d398:new _0x532e4d(function(_0x579e0e){_0x579e0e(_0x56d398);});}return new(_0x532e4d||(_0x532e4d=Promise))(function(_0x228706,_0x477131){function _0x250412(_0x3ac6bf){try{_0x2bbc83(_0x3ab447['next'](_0x3ac6bf));}catch(_0x240cea){_0x477131(_0x240cea);}}function _0x47ddc2(_0x2134f1){try{_0x2bbc83(_0x3ab447['throw'](_0x2134f1));}catch(_0xec1b59){_0x477131(_0xec1b59);}}function _0x2bbc83(_0x10ce95){_0x10ce95['done']?_0x228706(_0x10ce95['value']):_0x5e40ee(_0x10ce95['value'])['then'](_0x250412,_0x47ddc2);}_0x2bbc83((_0x3ab447=_0x3ab447['apply'](_0x493fbf,_0x2b3a8e||[]))['next']());});};class ApiKeyService{constructor(_0x43e298){this['fetch']=_0x43e298;}['create'](_0x3102ed,_0x2a82e5,_0xa0a72b){return __awaiter$3(this,void 0,void 0,function*(){const _0x800e6f='ApiKey/Create',_0x47359f={'account_name':_0x3102ed,'name':_0x2a82e5};try{const _0x4a4d13=yield this['fetch']['post'](_0x800e6f,_0xa0a72b,_0x47359f);if(_0x4a4d13['status']>0xc7&&_0x4a4d13['status']<0x12c){const _0x1880f5=yield _0x4a4d13['json']();return new SuccessfulApiKeyResponse(_0x1880f5);}const _0x593db8=yield _0x4a4d13['json']();return new FailedApiKeyResponse(_0x593db8);}catch(_0x40832a){if(_0x40832a instanceof Error)return new FailedApiKeyResponse({'detail':_0x40832a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x40832a;}});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4d6946,_0x158da6,_0x23b090,_0x5321ef){function _0x255d11(_0x1daf43){return _0x1daf43 instanceof _0x23b090?_0x1daf43:new _0x23b090(function(_0x20df5f){_0x20df5f(_0x1daf43);});}return new(_0x23b090||(_0x23b090=Promise))(function(_0x345980,_0x130395){function _0xd8a402(_0x4bfe5d){try{_0x131506(_0x5321ef['next'](_0x4bfe5d));}catch(_0x16666a){_0x130395(_0x16666a);}}function _0x28ab9a(_0x268837){try{_0x131506(_0x5321ef['throw'](_0x268837));}catch(_0x4d7c7b){_0x130395(_0x4d7c7b);}}function _0x131506(_0x1a5e80){_0x1a5e80['done']?_0x345980(_0x1a5e80['value']):_0x255d11(_0x1a5e80['value'])['then'](_0xd8a402,_0x28ab9a);}_0x131506((_0x5321ef=_0x5321ef['apply'](_0x4d6946,_0x158da6||[]))['next']());});};class ListService{constructor(_0x1b4447){this['fetch']=_0x1b4447;}['add'](_0x2bb44d,_0x546294,_0x461737){return __awaiter$2(this,void 0,void 0,function*(){const _0xa5b684='List',_0x299626={'account_name':_0x2bb44d,'list_name':_0x546294};try{const _0xa074ae=yield this['fetch']['post'](_0xa5b684,_0x461737,_0x299626);if(_0xa074ae['status']>0xc7&&_0xa074ae['status']<0x12c){const _0xd32ffe=yield _0xa074ae['json']();return new SuccessfulAccountResponse(_0xd32ffe);}const _0x2ea622=yield _0xa074ae['json']();return new FailedAccountResponse(_0x2ea622);}catch(_0x584934){if(_0x584934 instanceof Error)return new FailedAccountResponse({'detail':_0x584934['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x584934;}});}['remove'](_0x244654,_0xf7bbc1,_0x5bcb72){return __awaiter$2(this,void 0,void 0,function*(){const _0x4aa5f7='List/'+_0x244654+'/'+_0xf7bbc1,_0x5bcc7b=yield this['fetch']['delete'](_0x4aa5f7,_0x5bcb72);try{if(_0x5bcc7b['status']>0xc7&&_0x5bcc7b['status']<0x12c){const _0x355b61=yield _0x5bcc7b['json']();return new SuccessfulAccountResponse(_0x355b61);}const _0x30eb7f=yield _0x5bcc7b['json']();return new FailedAccountResponse(_0x30eb7f);}catch(_0x1f7a31){if(_0x1f7a31 instanceof Error)return new FailedAccountResponse({'detail':_0x1f7a31['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1f7a31;}});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5cce3a,_0x471e96,_0x51ab35,_0x488726){function _0x349cdb(_0x512f76){return _0x512f76 instanceof _0x51ab35?_0x512f76:new _0x51ab35(function(_0x4752ec){_0x4752ec(_0x512f76);});}return new(_0x51ab35||(_0x51ab35=Promise))(function(_0x46623c,_0x3845ca){function _0x379db1(_0x4c5992){try{_0x46f509(_0x488726['next'](_0x4c5992));}catch(_0x1e8aae){_0x3845ca(_0x1e8aae);}}function _0x3c157d(_0x153929){try{_0x46f509(_0x488726['throw'](_0x153929));}catch(_0x159cd1){_0x3845ca(_0x159cd1);}}function _0x46f509(_0x25017c){_0x25017c['done']?_0x46623c(_0x25017c['value']):_0x349cdb(_0x25017c['value'])['then'](_0x379db1,_0x3c157d);}_0x46f509((_0x488726=_0x488726['apply'](_0x5cce3a,_0x471e96||[]))['next']());});};class Fetch{constructor(_0x48cf35){this['baseUri']=_0x48cf35,this['getUrl']=_0x2e27f9=>{return _0x2e27f9['startsWith']('/')&&(_0x2e27f9=_0x2e27f9['replace']('/','')),''+this['baseUri']+_0x2e27f9;},!_0x48cf35['endsWith']('/')&&(_0x48cf35=_0x48cf35+'/');}['get'](_0x5e3020,_0x1ccf8f){return __awaiter$1(this,void 0,void 0,function*(){const _0x2ce524=this['getUrl'](_0x5e3020);return yield fetch(_0x2ce524,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1ccf8f}});});}['post'](_0x129067,_0x50dd0c,_0x1ce492){return __awaiter$1(this,void 0,void 0,function*(){const _0x3efc81=this['getUrl'](_0x129067);return yield fetch(_0x3efc81,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x50dd0c},'body':_0x1ce492?JSON['stringify'](_0x1ce492):null});});}['put'](_0x1d21fb,_0x37d94e,_0x4d7e0f){return __awaiter$1(this,void 0,void 0,function*(){const _0x29e41d=this['getUrl'](_0x1d21fb);return yield fetch(_0x29e41d,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x37d94e},'body':_0x4d7e0f?JSON['stringify'](_0x4d7e0f):null});});}['delete'](_0x35b1c5,_0x73c78e){return __awaiter$1(this,void 0,void 0,function*(){const _0x486371=this['getUrl'](_0x35b1c5);return yield fetch(_0x486371,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x73c78e}});});}}
|
|
12
|
-
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x1087ac,_0x592444,_0x869b98,_0x1c708b){function _0x164bed(_0x2c812e){return _0x2c812e instanceof _0x869b98?_0x2c812e:new _0x869b98(function(_0x3976c4){_0x3976c4(_0x2c812e);});}return new(_0x869b98||(_0x869b98=Promise))(function(_0x49d719,_0x332193){function _0x500ea4(_0x3675e0){try{_0x2b3a9c(_0x1c708b['next'](_0x3675e0));}catch(_0x4962f8){_0x332193(_0x4962f8);}}function _0x177d88(_0x1fd817){try{_0x2b3a9c(_0x1c708b['throw'](_0x1fd817));}catch(_0x2f2cfd){_0x332193(_0x2f2cfd);}}function _0x2b3a9c(_0x2b207b){_0x2b207b['done']?_0x49d719(_0x2b207b['value']):_0x164bed(_0x2b207b['value'])['then'](_0x500ea4,_0x177d88);}_0x2b3a9c((_0x1c708b=_0x1c708b['apply'](_0x1087ac,_0x592444||[]))['next']());});};class AdminClient{constructor(_0x671dc9='https://admin.searchability.dev/'){var _0x3d4602=new Fetch(_0x671dc9);this['Accounts']=new AccountService(_0x3d4602),this['Lists']=new ListService(_0x3d4602),this['ApiKeys']=new ApiKeyService(_0x3d4602);}}class AuthClient{constructor(_0x4e121a='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x4e121a);}['login'](_0x49d261){return __awaiter(this,void 0,void 0,function*(){var _0x4aca23='login/'+_0x49d261;try{const _0x435990=yield yield fetch(_0x4aca23);if(_0x435990['status']>0xc7&&_0x435990['status']<0x12c){const _0x2ee1c2=yield _0x435990['json']();return new SuccessfulAuthResponse(_0x2ee1c2);}const _0x3a4c1f=yield _0x435990['json']();return new FailedAuthResponse(_0x3a4c1f);}catch(_0xdfac83){if(_0xdfac83 instanceof Error)return new FailedAuthResponse({'detail':_0xdfac83['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xdfac83;}});}['refresh'](_0xabba94){return __awaiter(this,void 0,void 0,function*(){var _0x5adb0f='refresh';try{const _0x12e09b=yield this['fetch']['post'](_0x5adb0f,_0xabba94,null);if(_0x12e09b['status']>0xc7&&_0x12e09b['status']<0x12c){const _0x5b9eee=yield _0x12e09b['json']();return new SuccessfulAuthResponse(_0x5b9eee);}const _0x218a4e=yield _0x12e09b['json']();return new FailedAuthResponse(_0x218a4e);}catch(_0x2ead5f){if(_0x2ead5f instanceof Error)return new FailedAuthResponse({'detail':_0x2ead5f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2ead5f;}});}}
|
|
14
|
-
|
|
15
|
-
export { AdminClient, AuthClient };
|