@searchability/admin-client 0.0.1 → 0.0.3

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,11 @@
1
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x38cb4c,_0x3a2fe2,_0x1d3d1a,_0x280376){function _0xd387e2(_0x327dac){return _0x327dac instanceof _0x1d3d1a?_0x327dac:new _0x1d3d1a(function(_0x2ebe5c){_0x2ebe5c(_0x327dac);});}return new(_0x1d3d1a||(_0x1d3d1a=Promise))(function(_0x5b0cef,_0x17dc57){function _0x507c5b(_0x2e12d9){try{_0x302aab(_0x280376['next'](_0x2e12d9));}catch(_0x1f6ee8){_0x17dc57(_0x1f6ee8);}}function _0x3eb112(_0x556586){try{_0x302aab(_0x280376['throw'](_0x556586));}catch(_0x1b7799){_0x17dc57(_0x1b7799);}}function _0x302aab(_0x142067){_0x142067['done']?_0x5b0cef(_0x142067['value']):_0xd387e2(_0x142067['value'])['then'](_0x507c5b,_0x3eb112);}_0x302aab((_0x280376=_0x280376['apply'](_0x38cb4c,_0x3a2fe2||[]))['next']());});};class Fetch{static['get'](_0x27d5f9,_0x298e59){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x27d5f9,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x298e59}});});}static['post'](_0xb2a114,_0xa962a3,_0x41c5d9){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0xb2a114,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xa962a3},'body':JSON['stringify'](_0x41c5d9)});});}static['put'](_0x3264a7,_0x45feeb,_0x17a883){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x3264a7,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x45feeb},'body':JSON['stringify'](_0x17a883)});});}static['delete'](_0x15dcec,_0x6cab31){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x15dcec,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x6cab31}});});}}
2
+
3
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x75bae0,_0x86f58a,_0x46d37e,_0x103eb1){function _0x4cd213(_0x58bae4){return _0x58bae4 instanceof _0x46d37e?_0x58bae4:new _0x46d37e(function(_0x41e8e0){_0x41e8e0(_0x58bae4);});}return new(_0x46d37e||(_0x46d37e=Promise))(function(_0x447c7d,_0x41a32c){function _0x38b7bd(_0x107105){try{_0x1dcd2c(_0x103eb1['next'](_0x107105));}catch(_0x51b647){_0x41a32c(_0x51b647);}}function _0x13f89c(_0x4544d3){try{_0x1dcd2c(_0x103eb1['throw'](_0x4544d3));}catch(_0x2b11e4){_0x41a32c(_0x2b11e4);}}function _0x1dcd2c(_0x478517){_0x478517['done']?_0x447c7d(_0x478517['value']):_0x4cd213(_0x478517['value'])['then'](_0x38b7bd,_0x13f89c);}_0x1dcd2c((_0x103eb1=_0x103eb1['apply'](_0x75bae0,_0x86f58a||[]))['next']());});};class ListService{constructor(_0x472bc7){this['baseUri']=_0x472bc7;}['add'](_0x4c409d,_0x50765a,_0x359ea8){return __awaiter$1(this,arguments,void 0,function*(_0x40fe6a,_0x10d243,_0x33eada,_0x47e1f3={}){var _0x136db9;let _0x395c15=(_0x136db9=_0x47e1f3['baseUri'])!==null&&_0x136db9!==void 0?_0x136db9:this['baseUri'];_0x395c15=_0x395c15+'/List';const _0xee9121={'account_name':_0x10d243,'list_name':_0x33eada},_0xa6f2e0=yield Fetch['post'](_0x395c15,_0x40fe6a,_0xee9121);if(_0xa6f2e0['status']>0xc7&&_0xa6f2e0['status']<0x12c){const _0x25dabf=yield _0xa6f2e0['json']();return new SuccessfulAccountResponse(_0x25dabf);}if(_0xa6f2e0['bodyUsed']){const _0x30ad80=yield _0xa6f2e0['json']();return new FailedAccountResponse(_0x30ad80);}const _0x11904b={'type':'','status':_0xa6f2e0['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x11904b);});}['remove'](_0x1a35fc,_0x194c5d,_0x5a0a80){return __awaiter$1(this,arguments,void 0,function*(_0x14873c,_0x2501ed,_0x1c6f9d,_0x42d865={}){var _0x4ef74d;let _0x1dd0eb=(_0x4ef74d=_0x42d865['baseUri'])!==null&&_0x4ef74d!==void 0?_0x4ef74d:this['baseUri'];_0x1dd0eb=_0x1dd0eb+'/List/'+_0x2501ed+'/'+_0x1c6f9d;const _0x2d31e5=yield Fetch['delete'](_0x1dd0eb,_0x14873c);if(_0x2d31e5['status']>0xc7&&_0x2d31e5['status']<0x12c){const _0x10c50a=yield _0x2d31e5['json']();return new SuccessfulAccountResponse(_0x10c50a);}if(_0x2d31e5['bodyUsed']){const _0x26131a=yield _0x2d31e5['json']();return new FailedAccountResponse(_0x26131a);}const _0x6a9eb6={'type':'','status':_0x2d31e5['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x6a9eb6);});}}
4
+
5
+ class Response{constructor(_0x1cfb16){this['isSuccess']=_0x1cfb16;}}class SuccessfulAccountResponse extends Response{constructor(_0x16ba11){super(!![]),this['account']=_0x16ba11;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3f58b6){super(![]),this['problem']=_0x3f58b6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
+
7
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x4024e0,_0x3bc326,_0x3e7eb7,_0x3a465d){function _0x6a781a(_0xe8ee3){return _0xe8ee3 instanceof _0x3e7eb7?_0xe8ee3:new _0x3e7eb7(function(_0x18d625){_0x18d625(_0xe8ee3);});}return new(_0x3e7eb7||(_0x3e7eb7=Promise))(function(_0x3d7204,_0x2f776e){function _0x91cede(_0x32ceed){try{_0x2c7f4c(_0x3a465d['next'](_0x32ceed));}catch(_0x74691b){_0x2f776e(_0x74691b);}}function _0x54c595(_0x2a5ad2){try{_0x2c7f4c(_0x3a465d['throw'](_0x2a5ad2));}catch(_0x29d587){_0x2f776e(_0x29d587);}}function _0x2c7f4c(_0x5dd149){_0x5dd149['done']?_0x3d7204(_0x5dd149['value']):_0x6a781a(_0x5dd149['value'])['then'](_0x91cede,_0x54c595);}_0x2c7f4c((_0x3a465d=_0x3a465d['apply'](_0x4024e0,_0x3bc326||[]))['next']());});};class AccountService{constructor(_0x3fc3e3){this['baseUri']=_0x3fc3e3;}['get'](_0x3375c9,_0x21cad5){return __awaiter(this,arguments,void 0,function*(_0x6622a6,_0x5be776,_0xae8c49={}){var _0x50a50a;let _0x4b8d13=(_0x50a50a=_0xae8c49['baseUri'])!==null&&_0x50a50a!==void 0?_0x50a50a:this['baseUri'];_0x4b8d13=_0x4b8d13+'/Account/'+_0x5be776+'/';const _0x17ed16=yield Fetch['get'](_0x4b8d13,_0x6622a6);if(_0x17ed16['status']>0xc7&&_0x17ed16['status']<0x12c){const _0x5502ac=yield _0x17ed16['json']();return new SuccessfulAccountResponse(_0x5502ac);}if(_0x17ed16['bodyUsed']){const _0x104819=yield _0x17ed16['json']();return new FailedAccountResponse(_0x104819);}const _0x4da027={'type':'','status':_0x17ed16['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x4da027);});}}
8
+
9
+ var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']);
10
+
11
+ export { AdminClient };
@@ -1,11 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5a75d9,_0x6ba4bc,_0x4cb627,_0x5aa308){function _0x23fbb3(_0x4f444a){return _0x4f444a instanceof _0x4cb627?_0x4f444a:new _0x4cb627(function(_0x4e8d3e){_0x4e8d3e(_0x4f444a);});}return new(_0x4cb627||(_0x4cb627=Promise))(function(_0x41ce9c,_0x3aeed0){function _0x18e4a5(_0x3a03e9){try{_0x4a0076(_0x5aa308['next'](_0x3a03e9));}catch(_0x1a240e){_0x3aeed0(_0x1a240e);}}function _0x37f5b4(_0x348154){try{_0x4a0076(_0x5aa308['throw'](_0x348154));}catch(_0x5d0995){_0x3aeed0(_0x5d0995);}}function _0x4a0076(_0x35a040){_0x35a040['done']?_0x41ce9c(_0x35a040['value']):_0x23fbb3(_0x35a040['value'])['then'](_0x18e4a5,_0x37f5b4);}_0x4a0076((_0x5aa308=_0x5aa308['apply'](_0x5a75d9,_0x6ba4bc||[]))['next']());});};class Fetch{static['get'](_0x4e9c86,_0xaac7bb){return __awaiter$1(this,void 0,void 0,function*(){return yield fetch(_0x4e9c86,{'method':'get','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xaac7bb}});});}}
3
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x42e2e9,_0x403889,_0x130588,_0x578018){function _0x4076d1(_0x501c1f){return _0x501c1f instanceof _0x130588?_0x501c1f:new _0x130588(function(_0x520ecb){_0x520ecb(_0x501c1f);});}return new(_0x130588||(_0x130588=Promise))(function(_0x1c8390,_0x34946f){function _0x343286(_0x3201d4){try{_0x4c4465(_0x578018['next'](_0x3201d4));}catch(_0x38bb3a){_0x34946f(_0x38bb3a);}}function _0x440db1(_0xb3e0b8){try{_0x4c4465(_0x578018['throw'](_0xb3e0b8));}catch(_0x1f4a1c){_0x34946f(_0x1f4a1c);}}function _0x4c4465(_0x2ffbfd){_0x2ffbfd['done']?_0x1c8390(_0x2ffbfd['value']):_0x4076d1(_0x2ffbfd['value'])['then'](_0x343286,_0x440db1);}_0x4c4465((_0x578018=_0x578018['apply'](_0x42e2e9,_0x403889||[]))['next']());});};class Fetch{static['get'](_0xa35740,_0x1a41e0){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0xa35740,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1a41e0}});});}static['post'](_0x24b26d,_0x250dee,_0x4a4fea){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x24b26d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x250dee},'body':JSON['stringify'](_0x4a4fea)});});}static['put'](_0x49c3b4,_0x2f34ea,_0x2407b8){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x49c3b4,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2f34ea},'body':JSON['stringify'](_0x2407b8)});});}static['delete'](_0x1e7637,_0x3c51cf){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x1e7637,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3c51cf}});});}}
4
4
 
5
- class Response{constructor(_0x78a668){this['isSuccess']=_0x78a668;}}class SuccessfulAccountResponse extends Response{constructor(_0x146923){super(!![]),this['account']=_0x146923;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xc83e06){super(![]),this['problem']=_0xc83e06;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
5
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2e51f5,_0x42dabe,_0x32d0eb,_0x226f52){function _0x1826d2(_0x27a638){return _0x27a638 instanceof _0x32d0eb?_0x27a638:new _0x32d0eb(function(_0x356174){_0x356174(_0x27a638);});}return new(_0x32d0eb||(_0x32d0eb=Promise))(function(_0x85b794,_0x2f77dd){function _0x2f362b(_0x186765){try{_0x2f3778(_0x226f52['next'](_0x186765));}catch(_0x5fdee7){_0x2f77dd(_0x5fdee7);}}function _0x1631de(_0x3064b2){try{_0x2f3778(_0x226f52['throw'](_0x3064b2));}catch(_0x5d5f3b){_0x2f77dd(_0x5d5f3b);}}function _0x2f3778(_0x303e25){_0x303e25['done']?_0x85b794(_0x303e25['value']):_0x1826d2(_0x303e25['value'])['then'](_0x2f362b,_0x1631de);}_0x2f3778((_0x226f52=_0x226f52['apply'](_0x2e51f5,_0x42dabe||[]))['next']());});};class ListService{constructor(_0x184d8b){this['baseUri']=_0x184d8b;}['add'](_0x3ee7c0,_0x17477c,_0x25f9b2){return __awaiter$1(this,arguments,void 0,function*(_0x20aa95,_0x2b49b0,_0x33e4da,_0x4728e8={}){var _0x3fa35a;let _0x37ed56=(_0x3fa35a=_0x4728e8['baseUri'])!==null&&_0x3fa35a!==void 0?_0x3fa35a:this['baseUri'];_0x37ed56=_0x37ed56+'/List';const _0x19f3ae={'account_name':_0x2b49b0,'list_name':_0x33e4da},_0x449fa1=yield Fetch['post'](_0x37ed56,_0x20aa95,_0x19f3ae);if(_0x449fa1['status']>0xc7&&_0x449fa1['status']<0x12c){const _0xa498de=yield _0x449fa1['json']();return new SuccessfulAccountResponse(_0xa498de);}if(_0x449fa1['bodyUsed']){const _0x1ea9e8=yield _0x449fa1['json']();return new FailedAccountResponse(_0x1ea9e8);}const _0x1a7272={'type':'','status':_0x449fa1['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x1a7272);});}['remove'](_0x3d037b,_0x2aa1f5,_0x595d66){return __awaiter$1(this,arguments,void 0,function*(_0x521ee6,_0x209e3b,_0x2fc9ae,_0x4aa2f5={}){var _0x16247b;let _0x3289db=(_0x16247b=_0x4aa2f5['baseUri'])!==null&&_0x16247b!==void 0?_0x16247b:this['baseUri'];_0x3289db=_0x3289db+'/List/'+_0x209e3b+'/'+_0x2fc9ae;const _0x1357f7=yield Fetch['delete'](_0x3289db,_0x521ee6);if(_0x1357f7['status']>0xc7&&_0x1357f7['status']<0x12c){const _0x33bc74=yield _0x1357f7['json']();return new SuccessfulAccountResponse(_0x33bc74);}if(_0x1357f7['bodyUsed']){const _0x31ff77=yield _0x1357f7['json']();return new FailedAccountResponse(_0x31ff77);}const _0x3cf923={'type':'','status':_0x1357f7['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x3cf923);});}}
6
6
 
7
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x3a5d36,_0x3e67e1,_0x3e596b,_0x56ba57){function _0xeb6baf(_0xd03f22){return _0xd03f22 instanceof _0x3e596b?_0xd03f22:new _0x3e596b(function(_0xb389b3){_0xb389b3(_0xd03f22);});}return new(_0x3e596b||(_0x3e596b=Promise))(function(_0x529db7,_0x4c0742){function _0x43fe38(_0x5bf0cd){try{_0x38bdca(_0x56ba57['next'](_0x5bf0cd));}catch(_0x1a86a1){_0x4c0742(_0x1a86a1);}}function _0x39a679(_0x59ff66){try{_0x38bdca(_0x56ba57['throw'](_0x59ff66));}catch(_0x189780){_0x4c0742(_0x189780);}}function _0x38bdca(_0x31767c){_0x31767c['done']?_0x529db7(_0x31767c['value']):_0xeb6baf(_0x31767c['value'])['then'](_0x43fe38,_0x39a679);}_0x38bdca((_0x56ba57=_0x56ba57['apply'](_0x3a5d36,_0x3e67e1||[]))['next']());});};class AccountService{constructor(){}['get'](_0x53e1db,_0x450685){return __awaiter(this,arguments,void 0,function*(_0x5ed4a2,_0x103326,_0x1bf6cb={}){let _0x487b69=_0x1bf6cb['baseUri'];_0x487b69=_0x487b69+'/Account/'+_0x103326+'/';const _0x3ab0c0=yield Fetch['get'](_0x487b69,_0x5ed4a2);if(_0x3ab0c0['status']>0xc7&&_0x3ab0c0['status']<0x12c){const _0x45e047=yield _0x3ab0c0['json']();return new SuccessfulAccountResponse(_0x45e047);}if(_0x3ab0c0['bodyUsed']){const _0x41e5f5=yield _0x3ab0c0['json']();return new FailedAccountResponse(_0x41e5f5);}const _0x4d83c8={'type':'','status':_0x3ab0c0['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x4d83c8);});}}
7
+ class Response{constructor(_0x596722){this['isSuccess']=_0x596722;}}class SuccessfulAccountResponse extends Response{constructor(_0x5a140e){super(!![]),this['account']=_0x5a140e;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x55e289){super(![]),this['problem']=_0x55e289;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
8
8
 
9
- class AdminClient{constructor(){this['baseUri']='https://admin.searchability.dev',this['Accounts']=new AccountService();}}
9
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x4aaa3a,_0x4dfee5,_0x55e236,_0x517770){function _0x53b140(_0x5aac72){return _0x5aac72 instanceof _0x55e236?_0x5aac72:new _0x55e236(function(_0x3e095c){_0x3e095c(_0x5aac72);});}return new(_0x55e236||(_0x55e236=Promise))(function(_0x424713,_0x25540c){function _0x3cb464(_0x26fc30){try{_0x3f39b9(_0x517770['next'](_0x26fc30));}catch(_0xb83374){_0x25540c(_0xb83374);}}function _0x1b67e7(_0xbe867f){try{_0x3f39b9(_0x517770['throw'](_0xbe867f));}catch(_0x1468b8){_0x25540c(_0x1468b8);}}function _0x3f39b9(_0x9fe10f){_0x9fe10f['done']?_0x424713(_0x9fe10f['value']):_0x53b140(_0x9fe10f['value'])['then'](_0x3cb464,_0x1b67e7);}_0x3f39b9((_0x517770=_0x517770['apply'](_0x4aaa3a,_0x4dfee5||[]))['next']());});};class AccountService{constructor(_0x1965ea){this['baseUri']=_0x1965ea;}['get'](_0x44db63,_0x43b467){return __awaiter(this,arguments,void 0,function*(_0x16950f,_0x3a28f2,_0x6b2b38={}){var _0x46dffe;let _0x33c862=(_0x46dffe=_0x6b2b38['baseUri'])!==null&&_0x46dffe!==void 0?_0x46dffe:this['baseUri'];_0x33c862=_0x33c862+'/Account/'+_0x3a28f2+'/';const _0x52ec1d=yield Fetch['get'](_0x33c862,_0x16950f);if(_0x52ec1d['status']>0xc7&&_0x52ec1d['status']<0x12c){const _0x4a107c=yield _0x52ec1d['json']();return new SuccessfulAccountResponse(_0x4a107c);}if(_0x52ec1d['bodyUsed']){const _0x4f95b8=yield _0x52ec1d['json']();return new FailedAccountResponse(_0x4f95b8);}const _0xede3be={'type':'','status':_0x52ec1d['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0xede3be);});}}
10
+
11
+ var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']);
10
12
 
11
13
  exports.AdminClient = AdminClient;
@@ -0,0 +1,11 @@
1
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x1468d7,_0x3012f1,_0x1d063a,_0x7ec5c0){function _0x330f18(_0x268a78){return _0x268a78 instanceof _0x1d063a?_0x268a78:new _0x1d063a(function(_0x418d46){_0x418d46(_0x268a78);});}return new(_0x1d063a||(_0x1d063a=Promise))(function(_0x340c8f,_0xd558ef){function _0x382a51(_0x55b9c9){try{_0x36e8c5(_0x7ec5c0['next'](_0x55b9c9));}catch(_0x145ab2){_0xd558ef(_0x145ab2);}}function _0x3bb0c1(_0x1c196c){try{_0x36e8c5(_0x7ec5c0['throw'](_0x1c196c));}catch(_0x594538){_0xd558ef(_0x594538);}}function _0x36e8c5(_0x3e634a){_0x3e634a['done']?_0x340c8f(_0x3e634a['value']):_0x330f18(_0x3e634a['value'])['then'](_0x382a51,_0x3bb0c1);}_0x36e8c5((_0x7ec5c0=_0x7ec5c0['apply'](_0x1468d7,_0x3012f1||[]))['next']());});};class Fetch{static['get'](_0x4f5e41,_0x4faf65){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x4f5e41,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4faf65}});});}static['post'](_0x45a3d6,_0x5d663c,_0x52d1ba){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x45a3d6,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5d663c},'body':JSON['stringify'](_0x52d1ba)});});}static['put'](_0x57d5d1,_0xa64f41,_0x32460a){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x57d5d1,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xa64f41},'body':JSON['stringify'](_0x32460a)});});}static['delete'](_0x3f9b29,_0x3cd2b3){return __awaiter$2(this,void 0,void 0,function*(){return yield fetch(_0x3f9b29,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3cd2b3}});});}}
2
+
3
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x36ceb9,_0x322bb6,_0x175a0e,_0xf8a365){function _0x5c368a(_0x1d1c84){return _0x1d1c84 instanceof _0x175a0e?_0x1d1c84:new _0x175a0e(function(_0x285495){_0x285495(_0x1d1c84);});}return new(_0x175a0e||(_0x175a0e=Promise))(function(_0x31ba46,_0x187fdf){function _0x1e840a(_0x313f32){try{_0x3d93d2(_0xf8a365['next'](_0x313f32));}catch(_0x2d279f){_0x187fdf(_0x2d279f);}}function _0x14c9b9(_0x4f4a07){try{_0x3d93d2(_0xf8a365['throw'](_0x4f4a07));}catch(_0x5ab919){_0x187fdf(_0x5ab919);}}function _0x3d93d2(_0x48cd9e){_0x48cd9e['done']?_0x31ba46(_0x48cd9e['value']):_0x5c368a(_0x48cd9e['value'])['then'](_0x1e840a,_0x14c9b9);}_0x3d93d2((_0xf8a365=_0xf8a365['apply'](_0x36ceb9,_0x322bb6||[]))['next']());});};class ListService{constructor(_0x5e59d0){this['baseUri']=_0x5e59d0;}['add'](_0x44a38d,_0x299c37,_0x169ce1){return __awaiter$1(this,arguments,void 0,function*(_0xb6bbe2,_0x1f7b0c,_0x3239f9,_0x116024={}){var _0x27a94a;let _0x397ecb=(_0x27a94a=_0x116024['baseUri'])!==null&&_0x27a94a!==void 0?_0x27a94a:this['baseUri'];_0x397ecb=_0x397ecb+'/List';const _0x29ec1e={'account_name':_0x1f7b0c,'list_name':_0x3239f9},_0x343a01=yield Fetch['post'](_0x397ecb,_0xb6bbe2,_0x29ec1e);if(_0x343a01['status']>0xc7&&_0x343a01['status']<0x12c){const _0xf62a4d=yield _0x343a01['json']();return new SuccessfulAccountResponse(_0xf62a4d);}if(_0x343a01['bodyUsed']){const _0x58f4c5=yield _0x343a01['json']();return new FailedAccountResponse(_0x58f4c5);}const _0x309844={'type':'','status':_0x343a01['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x309844);});}['remove'](_0x3a6106,_0x4d76b5,_0x426496){return __awaiter$1(this,arguments,void 0,function*(_0x35f5f8,_0x26097c,_0x150a90,_0x4482bc={}){var _0x5515d0;let _0xe6f210=(_0x5515d0=_0x4482bc['baseUri'])!==null&&_0x5515d0!==void 0?_0x5515d0:this['baseUri'];_0xe6f210=_0xe6f210+'/List/'+_0x26097c+'/'+_0x150a90;const _0x5e4758=yield Fetch['delete'](_0xe6f210,_0x35f5f8);if(_0x5e4758['status']>0xc7&&_0x5e4758['status']<0x12c){const _0x3a3ff3=yield _0x5e4758['json']();return new SuccessfulAccountResponse(_0x3a3ff3);}if(_0x5e4758['bodyUsed']){const _0x30daf5=yield _0x5e4758['json']();return new FailedAccountResponse(_0x30daf5);}const _0x55c879={'type':'','status':_0x5e4758['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x55c879);});}}
4
+
5
+ class Response{constructor(_0x275c8d){this['isSuccess']=_0x275c8d;}}class SuccessfulAccountResponse extends Response{constructor(_0x4cda14){super(!![]),this['account']=_0x4cda14;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x4097e8){super(![]),this['problem']=_0x4097e8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
+
7
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x43fd33,_0x5bc612,_0x29f078,_0x481bad){function _0x30b509(_0x490344){return _0x490344 instanceof _0x29f078?_0x490344:new _0x29f078(function(_0x3e715f){_0x3e715f(_0x490344);});}return new(_0x29f078||(_0x29f078=Promise))(function(_0x491f78,_0x168c25){function _0x34afd6(_0x53f635){try{_0x3b5dee(_0x481bad['next'](_0x53f635));}catch(_0x5b9e50){_0x168c25(_0x5b9e50);}}function _0x48107f(_0x104206){try{_0x3b5dee(_0x481bad['throw'](_0x104206));}catch(_0x3e473f){_0x168c25(_0x3e473f);}}function _0x3b5dee(_0x3fdae8){_0x3fdae8['done']?_0x491f78(_0x3fdae8['value']):_0x30b509(_0x3fdae8['value'])['then'](_0x34afd6,_0x48107f);}_0x3b5dee((_0x481bad=_0x481bad['apply'](_0x43fd33,_0x5bc612||[]))['next']());});};class AccountService{constructor(_0x417268){this['baseUri']=_0x417268;}['get'](_0x11d5c2,_0x2780a5){return __awaiter(this,arguments,void 0,function*(_0x53e631,_0x14fe51,_0x2394ec={}){var _0x109135;let _0x204710=(_0x109135=_0x2394ec['baseUri'])!==null&&_0x109135!==void 0?_0x109135:this['baseUri'];_0x204710=_0x204710+'/Account/'+_0x14fe51+'/';const _0x41bad9=yield Fetch['get'](_0x204710,_0x53e631);if(_0x41bad9['status']>0xc7&&_0x41bad9['status']<0x12c){const _0x14a80b=yield _0x41bad9['json']();return new SuccessfulAccountResponse(_0x14a80b);}if(_0x41bad9['bodyUsed']){const _0x45b834=yield _0x41bad9['json']();return new FailedAccountResponse(_0x45b834);}const _0x1c22aa={'type':'','status':_0x41bad9['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x1c22aa);});}}
8
+
9
+ var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']);
10
+
11
+ export { AdminClient };
package/dist/types.d.ts CHANGED
@@ -1,12 +1,32 @@
1
1
  declare class AccountService {
2
- constructor();
2
+ readonly baseUri: string;
3
+ constructor(baseUri: string);
3
4
  get(accessToken: string, accountName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
4
5
  }
5
6
 
7
+ type AccountService_d_AccountService = AccountService;
8
+ declare const AccountService_d_AccountService: typeof AccountService;
9
+ declare namespace AccountService_d {
10
+ export { AccountService_d_AccountService as AccountService };
11
+ }
12
+
13
+ declare class ListService {
14
+ readonly baseUri: string;
15
+ constructor(baseUri: string);
16
+ add(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
17
+ remove(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
18
+ }
19
+
20
+ type ListService_d_ListService = ListService;
21
+ declare const ListService_d_ListService: typeof ListService;
22
+ declare namespace ListService_d {
23
+ export { ListService_d_ListService as ListService };
24
+ }
25
+
6
26
  declare class AdminClient {
7
- readonly baseUri = "https://admin.searchability.dev";
8
- readonly Accounts: AccountService;
9
- constructor();
27
+ static baseUri: string;
28
+ static Accounts: AccountService;
29
+ static Lists: ListService;
10
30
  }
11
31
 
12
32
  type Options = {
@@ -18,24 +38,12 @@ declare abstract class Response<S, F> {
18
38
  abstract toSuccess(): S;
19
39
  abstract toProblem(): F;
20
40
  }
21
- type Account = {
22
- name: string;
23
- owner: string;
24
- created_utc: Date;
25
- lists: List[];
26
- };
27
41
  type List = {
28
42
  name: string;
29
43
  };
30
44
  type Error = {
31
45
  [key: string]: string[];
32
46
  };
33
- declare class SuccessfulAccountResponse extends Response<Account, Problem> {
34
- readonly account: Account;
35
- constructor(account: Account);
36
- toSuccess(): Account;
37
- toProblem(): Problem;
38
- }
39
47
  type Problem = {
40
48
  type: string;
41
49
  title: string;
@@ -43,6 +51,18 @@ type Problem = {
43
51
  instance: string;
44
52
  errors: Error;
45
53
  };
54
+ type Account = {
55
+ name: string;
56
+ owner: string;
57
+ created_utc: Date;
58
+ lists: List[];
59
+ };
60
+ declare class SuccessfulAccountResponse extends Response<Account, Problem> {
61
+ readonly account: Account;
62
+ constructor(account: Account);
63
+ toSuccess(): Account;
64
+ toProblem(): Problem;
65
+ }
46
66
  declare class FailedAccountResponse extends Response<Account, Problem> {
47
67
  readonly problem: Problem;
48
68
  constructor(problem: Problem);
@@ -50,4 +70,4 @@ declare class FailedAccountResponse extends Response<Account, Problem> {
50
70
  toProblem(): Problem;
51
71
  }
52
72
 
53
- export { type Account, AdminClient, type Error, FailedAccountResponse, type List, type Options, type Problem, Response, SuccessfulAccountResponse };
73
+ export { type Account, AccountService_d as AccountServices, AdminClient, type Error, FailedAccountResponse, type List, ListService_d as ListServices, type Options, type Problem, Response, SuccessfulAccountResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -8,7 +8,7 @@
8
8
  "exports": {
9
9
  "import":{
10
10
  "types":"./dist/types.d.ts",
11
- "default":"./dist/searchability-admin-client.js"
11
+ "default":"./dist/searchability-admin-client.mjs"
12
12
  },
13
13
  "require":{
14
14
  "types":"./dist/types.d.ts",
@@ -1,9 +0,0 @@
1
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2ec56e,_0x30298d,_0xb65223,_0x1cad79){function _0x473bb1(_0x3da147){return _0x3da147 instanceof _0xb65223?_0x3da147:new _0xb65223(function(_0xe8f72b){_0xe8f72b(_0x3da147);});}return new(_0xb65223||(_0xb65223=Promise))(function(_0x29e400,_0x2a27f3){function _0x535586(_0x2f7973){try{_0x3675de(_0x1cad79['next'](_0x2f7973));}catch(_0x458bfa){_0x2a27f3(_0x458bfa);}}function _0x287771(_0x350ea5){try{_0x3675de(_0x1cad79['throw'](_0x350ea5));}catch(_0x4ffc7b){_0x2a27f3(_0x4ffc7b);}}function _0x3675de(_0x3b038a){_0x3b038a['done']?_0x29e400(_0x3b038a['value']):_0x473bb1(_0x3b038a['value'])['then'](_0x535586,_0x287771);}_0x3675de((_0x1cad79=_0x1cad79['apply'](_0x2ec56e,_0x30298d||[]))['next']());});};class Fetch{static['get'](_0x4d40e0,_0x67bbc9){return __awaiter$1(this,void 0,void 0,function*(){return yield fetch(_0x4d40e0,{'method':'get','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x67bbc9}});});}}
2
-
3
- class Response{constructor(_0x345240){this['isSuccess']=_0x345240;}}class SuccessfulAccountResponse extends Response{constructor(_0x47e5af){super(!![]),this['account']=_0x47e5af;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1babe2){super(![]),this['problem']=_0x1babe2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
-
5
- var __awaiter=undefined&&undefined['__awaiter']||function(_0xd89516,_0x3ae92c,_0x251e40,_0x1b04f7){function _0x157ec3(_0xd83d87){return _0xd83d87 instanceof _0x251e40?_0xd83d87:new _0x251e40(function(_0x24dfda){_0x24dfda(_0xd83d87);});}return new(_0x251e40||(_0x251e40=Promise))(function(_0x4b0c38,_0x104ea9){function _0x419869(_0x4f155b){try{_0x4ef678(_0x1b04f7['next'](_0x4f155b));}catch(_0x80c5e){_0x104ea9(_0x80c5e);}}function _0x219362(_0x218553){try{_0x4ef678(_0x1b04f7['throw'](_0x218553));}catch(_0x14ec6b){_0x104ea9(_0x14ec6b);}}function _0x4ef678(_0x1cff1f){_0x1cff1f['done']?_0x4b0c38(_0x1cff1f['value']):_0x157ec3(_0x1cff1f['value'])['then'](_0x419869,_0x219362);}_0x4ef678((_0x1b04f7=_0x1b04f7['apply'](_0xd89516,_0x3ae92c||[]))['next']());});};class AccountService{constructor(){}['get'](_0x2fce04,_0x564285){return __awaiter(this,arguments,void 0,function*(_0x2c64e6,_0x4fe00f,_0x55a52e={}){let _0x26e3d3=_0x55a52e['baseUri'];_0x26e3d3=_0x26e3d3+'/Account/'+_0x4fe00f+'/';const _0x236137=yield Fetch['get'](_0x26e3d3,_0x2c64e6);if(_0x236137['status']>0xc7&&_0x236137['status']<0x12c){const _0x5e6854=yield _0x236137['json']();return new SuccessfulAccountResponse(_0x5e6854);}if(_0x236137['bodyUsed']){const _0x58011e=yield _0x236137['json']();return new FailedAccountResponse(_0x58011e);}const _0x523223={'type':'','status':_0x236137['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x523223);});}}
6
-
7
- class AdminClient{constructor(){this['baseUri']='https://admin.searchability.dev',this['Accounts']=new AccountService();}}
8
-
9
- export { AdminClient };
@@ -1,9 +0,0 @@
1
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xe1d169,_0x310f23,_0x7dc183,_0x4ebf66){function _0x27cc91(_0x59207e){return _0x59207e instanceof _0x7dc183?_0x59207e:new _0x7dc183(function(_0x44a99e){_0x44a99e(_0x59207e);});}return new(_0x7dc183||(_0x7dc183=Promise))(function(_0x4c2c2e,_0x18f062){function _0x2ea042(_0x48e8ba){try{_0xf92b18(_0x4ebf66['next'](_0x48e8ba));}catch(_0x213d08){_0x18f062(_0x213d08);}}function _0x3727e4(_0x4efdb9){try{_0xf92b18(_0x4ebf66['throw'](_0x4efdb9));}catch(_0x511180){_0x18f062(_0x511180);}}function _0xf92b18(_0x15e3a4){_0x15e3a4['done']?_0x4c2c2e(_0x15e3a4['value']):_0x27cc91(_0x15e3a4['value'])['then'](_0x2ea042,_0x3727e4);}_0xf92b18((_0x4ebf66=_0x4ebf66['apply'](_0xe1d169,_0x310f23||[]))['next']());});};class Fetch{static['get'](_0x16edad,_0x2295b1){return __awaiter$1(this,void 0,void 0,function*(){return yield fetch(_0x16edad,{'method':'get','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2295b1}});});}}
2
-
3
- class Response{constructor(_0x4b4b5a){this['isSuccess']=_0x4b4b5a;}}class SuccessfulAccountResponse extends Response{constructor(_0x3a9d48){super(!![]),this['account']=_0x3a9d48;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x42d662){super(![]),this['problem']=_0x42d662;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
-
5
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x5efb31,_0x213af3,_0x2d164a,_0x25532e){function _0x172889(_0x3f1a1e){return _0x3f1a1e instanceof _0x2d164a?_0x3f1a1e:new _0x2d164a(function(_0x192ded){_0x192ded(_0x3f1a1e);});}return new(_0x2d164a||(_0x2d164a=Promise))(function(_0x500ae5,_0x557cfd){function _0x522302(_0x3a04cc){try{_0x123439(_0x25532e['next'](_0x3a04cc));}catch(_0x395e2e){_0x557cfd(_0x395e2e);}}function _0x3401a1(_0x5c39d5){try{_0x123439(_0x25532e['throw'](_0x5c39d5));}catch(_0x24e2cd){_0x557cfd(_0x24e2cd);}}function _0x123439(_0x3208d1){_0x3208d1['done']?_0x500ae5(_0x3208d1['value']):_0x172889(_0x3208d1['value'])['then'](_0x522302,_0x3401a1);}_0x123439((_0x25532e=_0x25532e['apply'](_0x5efb31,_0x213af3||[]))['next']());});};class AccountService{constructor(){}['get'](_0x1522eb,_0x5c9b66){return __awaiter(this,arguments,void 0,function*(_0x50fe7d,_0x2929d1,_0x4f59e7={}){let _0x15bb2e=_0x4f59e7['baseUri'];_0x15bb2e=_0x15bb2e+'/Account/'+_0x2929d1+'/';const _0x2c7e24=yield Fetch['get'](_0x15bb2e,_0x50fe7d);if(_0x2c7e24['status']>0xc7&&_0x2c7e24['status']<0x12c){const _0x5151f1=yield _0x2c7e24['json']();return new SuccessfulAccountResponse(_0x5151f1);}if(_0x2c7e24['bodyUsed']){const _0x50d428=yield _0x2c7e24['json']();return new FailedAccountResponse(_0x50d428);}const _0x285dc0={'type':'','status':_0x2c7e24['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x285dc0);});}}
6
-
7
- class AdminClient{constructor(){this['baseUri']='https://admin.searchability.dev',this['Accounts']=new AccountService();}}
8
-
9
- export { AdminClient };