@searchability/admin-client 0.0.2 → 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$
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
var
|
|
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;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
var __awaiter$
|
|
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
2
|
|
|
3
|
-
|
|
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
4
|
|
|
5
|
-
|
|
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
6
|
|
|
7
|
-
var
|
|
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']);
|
|
8
10
|
|
|
9
11
|
export { AdminClient };
|
package/dist/types.d.ts
CHANGED
|
@@ -4,9 +4,29 @@ declare class AccountService {
|
|
|
4
4
|
get(accessToken: string, accountName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
type AccountService_d_AccountService = AccountService;
|
|
8
|
+
declare const AccountService_d_AccountService: typeof AccountService;
|
|
9
|
+
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
|
+
|
|
7
26
|
declare class AdminClient {
|
|
8
27
|
static baseUri: string;
|
|
9
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,9 +0,0 @@
|
|
|
1
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1cd876,_0x1aba90,_0x4f56f2,_0x430be3){function _0x26d4f7(_0x481acd){return _0x481acd instanceof _0x4f56f2?_0x481acd:new _0x4f56f2(function(_0x1eb483){_0x1eb483(_0x481acd);});}return new(_0x4f56f2||(_0x4f56f2=Promise))(function(_0x297f96,_0x46b7ac){function _0x228e6b(_0xe72e32){try{_0x1bb595(_0x430be3['next'](_0xe72e32));}catch(_0x326de8){_0x46b7ac(_0x326de8);}}function _0x28186d(_0x45774d){try{_0x1bb595(_0x430be3['throw'](_0x45774d));}catch(_0x2dfa29){_0x46b7ac(_0x2dfa29);}}function _0x1bb595(_0x325ec9){_0x325ec9['done']?_0x297f96(_0x325ec9['value']):_0x26d4f7(_0x325ec9['value'])['then'](_0x228e6b,_0x28186d);}_0x1bb595((_0x430be3=_0x430be3['apply'](_0x1cd876,_0x1aba90||[]))['next']());});};class Fetch{static['get'](_0x2155a2,_0x8f94cf){return __awaiter$1(this,void 0,void 0,function*(){return yield fetch(_0x2155a2,{'method':'get','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x8f94cf}});});}}
|
|
2
|
-
|
|
3
|
-
class Response{constructor(_0x15129d){this['isSuccess']=_0x15129d;}}class SuccessfulAccountResponse extends Response{constructor(_0x2839e7){super(!![]),this['account']=_0x2839e7;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x149a88){super(![]),this['problem']=_0x149a88;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
|
-
|
|
5
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x4224ec,_0x31ccfb,_0x32f87c,_0x3e6c2b){function _0x3b51ac(_0xb3a6fa){return _0xb3a6fa instanceof _0x32f87c?_0xb3a6fa:new _0x32f87c(function(_0x5ecfaa){_0x5ecfaa(_0xb3a6fa);});}return new(_0x32f87c||(_0x32f87c=Promise))(function(_0x1cfd4e,_0x5e7013){function _0x35852c(_0x23398e){try{_0x4774d8(_0x3e6c2b['next'](_0x23398e));}catch(_0x3ba682){_0x5e7013(_0x3ba682);}}function _0x2667c6(_0x236366){try{_0x4774d8(_0x3e6c2b['throw'](_0x236366));}catch(_0x584b6f){_0x5e7013(_0x584b6f);}}function _0x4774d8(_0x2305e6){_0x2305e6['done']?_0x1cfd4e(_0x2305e6['value']):_0x3b51ac(_0x2305e6['value'])['then'](_0x35852c,_0x2667c6);}_0x4774d8((_0x3e6c2b=_0x3e6c2b['apply'](_0x4224ec,_0x31ccfb||[]))['next']());});};class AccountService{constructor(_0xd9588b){this['baseUri']=_0xd9588b;}['get'](_0x50b3bd,_0x2aac6d){return __awaiter(this,arguments,void 0,function*(_0x547146,_0x3f1702,_0x2efcbc={}){var _0x17116d;let _0x55bc6a=(_0x17116d=_0x2efcbc['baseUri'])!==null&&_0x17116d!==void 0?_0x17116d:this['baseUri'];_0x55bc6a=_0x55bc6a+'/Account/'+_0x3f1702+'/';const _0x206704=yield Fetch['get'](_0x55bc6a,_0x547146);if(_0x206704['status']>0xc7&&_0x206704['status']<0x12c){const _0x579ec6=yield _0x206704['json']();return new SuccessfulAccountResponse(_0x579ec6);}if(_0x206704['bodyUsed']){const _0x312596=yield _0x206704['json']();return new FailedAccountResponse(_0x312596);}const _0x2891d2={'type':'','status':_0x206704['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x2891d2);});}}
|
|
6
|
-
|
|
7
|
-
var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']);
|
|
8
|
-
|
|
9
|
-
export { AdminClient };
|