@blackglory/estore-js 0.2.4 → 0.4.0

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.
Files changed (77) hide show
  1. package/README.md +26 -221
  2. package/lib/contract.d.ts +16 -0
  3. package/lib/contract.js +2 -0
  4. package/lib/contract.js.map +1 -0
  5. package/lib/estore-client.d.ts +27 -0
  6. package/lib/estore-client.js +62 -0
  7. package/lib/estore-client.js.map +1 -0
  8. package/lib/index.d.ts +1 -0
  9. package/lib/index.js +2 -0
  10. package/lib/index.js.map +1 -0
  11. package/lib/utils/rpc-client.browser.d.ts +8 -0
  12. package/lib/utils/rpc-client.browser.js +24 -0
  13. package/lib/utils/rpc-client.browser.js.map +1 -0
  14. package/lib/utils/rpc-client.d.ts +8 -0
  15. package/lib/utils/rpc-client.js +25 -0
  16. package/lib/utils/rpc-client.js.map +1 -0
  17. package/package.json +47 -32
  18. package/lib/es2015/client.d.ts +0 -41
  19. package/lib/es2015/client.js +0 -139
  20. package/lib/es2015/client.js.map +0 -1
  21. package/lib/es2015/index.d.ts +0 -2
  22. package/lib/es2015/index.js +0 -15
  23. package/lib/es2015/index.js.map +0 -1
  24. package/lib/es2015/manager/base.d.ts +0 -13
  25. package/lib/es2015/manager/base.js +0 -26
  26. package/lib/es2015/manager/base.js.map +0 -1
  27. package/lib/es2015/manager/blacklist-manager.d.ts +0 -6
  28. package/lib/es2015/manager/blacklist-manager.js +0 -41
  29. package/lib/es2015/manager/blacklist-manager.js.map +0 -1
  30. package/lib/es2015/manager/index.d.ts +0 -20
  31. package/lib/es2015/manager/index.js +0 -20
  32. package/lib/es2015/manager/index.js.map +0 -1
  33. package/lib/es2015/manager/json-schema-manager.d.ts +0 -8
  34. package/lib/es2015/manager/json-schema-manager.js +0 -49
  35. package/lib/es2015/manager/json-schema-manager.js.map +0 -1
  36. package/lib/es2015/manager/token-manager.d.ts +0 -18
  37. package/lib/es2015/manager/token-manager.js +0 -73
  38. package/lib/es2015/manager/token-manager.js.map +0 -1
  39. package/lib/es2015/manager/token-policy-manager.d.ts +0 -17
  40. package/lib/es2015/manager/token-policy-manager.js +0 -73
  41. package/lib/es2015/manager/token-policy-manager.js.map +0 -1
  42. package/lib/es2015/manager/whitelist-manager.d.ts +0 -6
  43. package/lib/es2015/manager/whitelist-manager.js +0 -41
  44. package/lib/es2015/manager/whitelist-manager.js.map +0 -1
  45. package/lib/es2015/utils.d.ts +0 -1
  46. package/lib/es2015/utils.js +0 -5
  47. package/lib/es2015/utils.js.map +0 -1
  48. package/lib/es2018/client.d.ts +0 -41
  49. package/lib/es2018/client.js +0 -110
  50. package/lib/es2018/client.js.map +0 -1
  51. package/lib/es2018/index.d.ts +0 -2
  52. package/lib/es2018/index.js +0 -15
  53. package/lib/es2018/index.js.map +0 -1
  54. package/lib/es2018/manager/base.d.ts +0 -13
  55. package/lib/es2018/manager/base.js +0 -26
  56. package/lib/es2018/manager/base.js.map +0 -1
  57. package/lib/es2018/manager/blacklist-manager.d.ts +0 -6
  58. package/lib/es2018/manager/blacklist-manager.js +0 -26
  59. package/lib/es2018/manager/blacklist-manager.js.map +0 -1
  60. package/lib/es2018/manager/index.d.ts +0 -20
  61. package/lib/es2018/manager/index.js +0 -20
  62. package/lib/es2018/manager/index.js.map +0 -1
  63. package/lib/es2018/manager/json-schema-manager.d.ts +0 -8
  64. package/lib/es2018/manager/json-schema-manager.js +0 -32
  65. package/lib/es2018/manager/json-schema-manager.js.map +0 -1
  66. package/lib/es2018/manager/token-manager.d.ts +0 -18
  67. package/lib/es2018/manager/token-manager.js +0 -48
  68. package/lib/es2018/manager/token-manager.js.map +0 -1
  69. package/lib/es2018/manager/token-policy-manager.d.ts +0 -17
  70. package/lib/es2018/manager/token-policy-manager.js +0 -48
  71. package/lib/es2018/manager/token-policy-manager.js.map +0 -1
  72. package/lib/es2018/manager/whitelist-manager.d.ts +0 -6
  73. package/lib/es2018/manager/whitelist-manager.js +0 -26
  74. package/lib/es2018/manager/whitelist-manager.js.map +0 -1
  75. package/lib/es2018/utils.d.ts +0 -1
  76. package/lib/es2018/utils.js +0 -5
  77. package/lib/es2018/utils.js.map +0 -1
@@ -1,139 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EStoreClient = void 0;
13
- const extra_fetch_1 = require("extra-fetch");
14
- const extra_request_1 = require("extra-request");
15
- const index_js_1 = require("extra-request/transformers/index.js");
16
- const http_status_1 = require("@blackglory/http-status");
17
- const extra_response_1 = require("extra-response");
18
- const extra_abort_1 = require("extra-abort");
19
- const types_1 = require("@blackglory/types");
20
- const utils_1 = require("./utils");
21
- class EStoreClient {
22
- constructor(options) {
23
- this.options = options;
24
- }
25
- getCommonTransformers(options) {
26
- var _a, _b, _c;
27
- const token = 'token' in options
28
- ? ((_a = options.token) !== null && _a !== void 0 ? _a : this.options.token)
29
- : this.options.token;
30
- const auth = this.options.basicAuth;
31
- return [
32
- (0, index_js_1.url)(this.options.server),
33
- auth && (0, index_js_1.basicAuth)(auth.username, auth.password),
34
- token && (0, index_js_1.searchParams)({ token }),
35
- (0, index_js_1.signal)((0, extra_abort_1.raceAbortSignals)([
36
- options.signal,
37
- options.timeout !== false && ((_b = (options.timeout && (0, extra_abort_1.timeoutSignal)(options.timeout))) !== null && _b !== void 0 ? _b : (this.options.timeout && (0, extra_abort_1.timeoutSignal)(this.options.timeout)))
38
- ])),
39
- ((_c = options.keepalive) !== null && _c !== void 0 ? _c : this.options.keepalive) && (0, index_js_1.keepalive)(),
40
- (0, index_js_1.header)('Accept-Version', utils_1.expectedVersion)
41
- ];
42
- }
43
- append(namespace, itemId, payload, index, options = {}) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- const req = (0, extra_request_1.post)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/events`), (0, types_1.isntUndefined)(index) && (0, index_js_1.header)('If-Match', `${index}`), (0, index_js_1.json)(payload));
46
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
47
- });
48
- }
49
- getEvent(namespace, itemId, index, options = {}) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/events/${index}`));
52
- try {
53
- return yield (0, extra_fetch_1.fetch)(req)
54
- .then(extra_response_1.ok)
55
- .then(extra_response_1.toJSON);
56
- }
57
- catch (e) {
58
- if (e instanceof http_status_1.NotFound)
59
- return undefined;
60
- throw e;
61
- }
62
- });
63
- }
64
- getEvents(namespace, itemId, options = {}) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/events`));
67
- try {
68
- return yield (0, extra_fetch_1.fetch)(req)
69
- .then(extra_response_1.ok)
70
- .then(extra_response_1.toJSON);
71
- }
72
- catch (e) {
73
- if (e instanceof http_status_1.NotFound)
74
- return undefined;
75
- throw e;
76
- }
77
- });
78
- }
79
- getSize(namespace, itemId, options = {}) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/size`));
82
- return yield (0, extra_fetch_1.fetch)(req)
83
- .then(extra_response_1.ok)
84
- .then(extra_response_1.toJSON);
85
- });
86
- }
87
- has(namespace, itemId, options = {}) {
88
- return __awaiter(this, void 0, void 0, function* () {
89
- const req = (0, extra_request_1.head)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}`));
90
- try {
91
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
92
- return true;
93
- }
94
- catch (e) {
95
- if (e instanceof http_status_1.NotFound)
96
- return false;
97
- throw e;
98
- }
99
- });
100
- }
101
- del(namespace, itemId, options = {}) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}`));
104
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
105
- });
106
- }
107
- clear(namespace, options = {}) {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}`));
110
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
111
- });
112
- }
113
- getAllItemIds(namespace, options = {}) {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items`));
116
- return yield (0, extra_fetch_1.fetch)(req)
117
- .then(extra_response_1.ok)
118
- .then(extra_response_1.toJSON);
119
- });
120
- }
121
- getAllNamespaces(options = {}) {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/estore'));
124
- return yield (0, extra_fetch_1.fetch)(req)
125
- .then(extra_response_1.ok)
126
- .then(extra_response_1.toJSON);
127
- });
128
- }
129
- stats(namespace, options = {}) {
130
- return __awaiter(this, void 0, void 0, function* () {
131
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/stats`));
132
- return yield (0, extra_fetch_1.fetch)(req)
133
- .then(extra_response_1.ok)
134
- .then(extra_response_1.toJSON);
135
- });
136
- }
137
- }
138
- exports.EStoreClient = EStoreClient;
139
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmC;AACnC,iDAA6E;AAC7E,kEAAmI;AACnI,yDAAkD;AAClD,mDAA2C;AAE3C,6CAA6D;AAC7D,6CAAiD;AACjD,mCAA4C;AA+B5C,MAAa,YAAY;IACvB,YAAoB,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;IAAG,CAAC;IAE7C,qBAAqB,CAC3B,OAA8E;;QAE9E,MAAM,KAAK,GAAG,OAAO,IAAI,OAAO;YAClB,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAA;QAEnC,OAAO;YACL,IAAA,cAAG,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YACxB,IAAI,IAAI,IAAA,oBAAS,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC;YAC/C,KAAK,IAAI,IAAA,uBAAY,EAAC,EAAE,KAAK,EAAE,CAAC;YAChC,IAAA,iBAAM,EAAC,IAAA,8BAAgB,EAAC;gBACtB,OAAO,CAAC,MAAM;gBACd,OAAO,CAAC,OAAO,KAAK,KAAK,IAAI,CAC3B,MAAA,CAAC,OAAO,CAAC,OAAO,IAAI,IAAA,2BAAa,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,mCACnD,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAA,2BAAa,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAC9D;aACF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BAAM,CAAa,CAAA;QAC7B,CAAC;KAAA;IAKK,KAAK,CACT,SAAiB,EACjB,UAAmD,EAAE;;YAErD,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,WAAW,SAAS,QAAQ,CAAC,CAC7C,CAAA;YAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;iBACpB,IAAI,CAAC,mBAAE,CAAC;iBACR,IAAI,CAAC,uBAAM,CAAU,CAAA;QAC1B,CAAC;KAAA;CACF;AAtND,oCAsNC"}
@@ -1,2 +0,0 @@
1
- export * from './client';
2
- export * from './manager';
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./client"), exports);
14
- __exportStar(require("./manager"), exports);
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB"}
@@ -1,13 +0,0 @@
1
- import { IHTTPOptionsTransformer } from 'extra-request';
2
- import type { IEStoreManagerOptions } from './index';
3
- import { Falsy } from 'justypes';
4
- export interface IEStoreManagerRequestOptions {
5
- signal?: AbortSignal;
6
- keepalive?: boolean;
7
- timeout?: number | false;
8
- }
9
- export declare class EStoreManagerBase {
10
- private options;
11
- constructor(options: IEStoreManagerOptions);
12
- protected getCommonTransformers(options: IEStoreManagerRequestOptions): Array<IHTTPOptionsTransformer | Falsy>;
13
- }
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EStoreManagerBase = void 0;
4
- const index_1 = require("extra-request/transformers/index");
5
- const extra_abort_1 = require("extra-abort");
6
- const utils_1 = require("../utils");
7
- class EStoreManagerBase {
8
- constructor(options) {
9
- this.options = options;
10
- }
11
- getCommonTransformers(options) {
12
- var _a, _b;
13
- return [
14
- (0, index_1.url)(this.options.server),
15
- (0, index_1.bearerAuth)(this.options.adminPassword),
16
- (0, index_1.signal)((0, extra_abort_1.raceAbortSignals)([
17
- options.signal,
18
- options.timeout !== false && ((_a = (options.timeout && (0, extra_abort_1.timeoutSignal)(options.timeout))) !== null && _a !== void 0 ? _a : (this.options.timeout && (0, extra_abort_1.timeoutSignal)(this.options.timeout)))
19
- ])),
20
- ((_b = options.keepalive) !== null && _b !== void 0 ? _b : this.options.keepalive) && (0, index_1.keepalive)(),
21
- (0, index_1.header)('Accept-Version', utils_1.expectedVersion)
22
- ];
23
- }
24
- }
25
- exports.EStoreManagerBase = EStoreManagerBase;
26
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/manager/base.ts"],"names":[],"mappings":";;;AACA,4DAA6F;AAC7F,6CAA6D;AAG7D,oCAA4C;AAQ5C,MAAa,iBAAiB;IAC5B,YAAoB,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IAAG,CAAC;IAE5C,qBAAqB,CAC7B,OAAqC;;QAErC,OAAO;YACL,IAAA,WAAG,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YACxB,IAAA,kBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;YACtC,IAAA,cAAM,EAAC,IAAA,8BAAgB,EAAC;gBACtB,OAAO,CAAC,MAAM;gBACd,OAAO,CAAC,OAAO,KAAK,KAAK,IAAI,CAC3B,MAAA,CAAC,OAAO,CAAC,OAAO,IAAI,IAAA,2BAAa,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,mCACnD,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAA,2BAAa,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAC9D;aACF,CAAC,CAAC;YACH,CAAC,MAAA,OAAO,CAAC,SAAS,mCAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,IAAA,iBAAS,GAAE;YAC5D,IAAA,cAAM,EAAC,gBAAgB,EAAE,uBAAe,CAAC;SAC1C,CAAA;IACH,CAAC;CACF;AApBD,8CAoBC"}
@@ -1,6 +0,0 @@
1
- import { IEStoreManagerRequestOptions, EStoreManagerBase } from './base';
2
- export declare class BlacklistManager extends EStoreManagerBase {
3
- getNamespaces(options?: IEStoreManagerRequestOptions): Promise<string[]>;
4
- add(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
5
- remove(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
6
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.BlacklistManager = void 0;
13
- const extra_fetch_1 = require("extra-fetch");
14
- const extra_request_1 = require("extra-request");
15
- const index_js_1 = require("extra-request/transformers/index.js");
16
- const extra_response_1 = require("extra-response");
17
- const base_1 = require("./base");
18
- class BlacklistManager extends base_1.EStoreManagerBase {
19
- getNamespaces(options = {}) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/blacklist'));
22
- return yield (0, extra_fetch_1.fetch)(req)
23
- .then(extra_response_1.ok)
24
- .then(extra_response_1.toJSON);
25
- });
26
- }
27
- add(namespace, options = {}) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/blacklist/${namespace}`));
30
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
31
- });
32
- }
33
- remove(namespace, options = {}) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/blacklist/${namespace}`));
36
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
37
- });
38
- }
39
- }
40
- exports.BlacklistManager = BlacklistManager;
41
- //# sourceMappingURL=blacklist-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blacklist-manager.js","sourceRoot":"","sources":["../../../src/manager/blacklist-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmC;AACnC,iDAA6C;AAC7C,kEAAoE;AACpE,mDAA2C;AAC3C,iCAAwE;AAExE,MAAa,gBAAiB,SAAQ,wBAAiB;IAI/C,aAAa,CAAC,UAAwC,EAAE;;YAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,kBAAkB,CAAC,CACnC,CAAA;YAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;iBACpB,IAAI,CAAC,mBAAE,CAAC;iBACR,IAAI,CAAC,uBAAM,CAAa,CAAA;QAC7B,CAAC;KAAA;IAKK,GAAG,CAAC,SAAiB,EAAE,UAAwC,EAAE;;YACrE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,oBAAoB,SAAS,EAAE,CAAC,CAChD,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;IAKK,MAAM,CAAC,SAAiB,EAAE,UAAwC,EAAE;;YACxE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,oBAAoB,SAAS,EAAE,CAAC,CAChD,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;CACF;AAtCD,4CAsCC"}
@@ -1,20 +0,0 @@
1
- import { JsonSchemaManager } from './json-schema-manager';
2
- import { BlacklistManager } from './blacklist-manager';
3
- import { WhitelistManager } from './whitelist-manager';
4
- import { TokenPolicyManager } from './token-policy-manager';
5
- import { TokenManager } from './token-manager';
6
- export interface IEStoreManagerOptions {
7
- server: string;
8
- adminPassword: string;
9
- keepalive?: boolean;
10
- timeout?: number;
11
- }
12
- export declare class EStoreManager {
13
- private options;
14
- constructor(options: IEStoreManagerOptions);
15
- JsonSchema: JsonSchemaManager;
16
- Blacklist: BlacklistManager;
17
- Whitelist: WhitelistManager;
18
- TokenPolicy: TokenPolicyManager;
19
- Token: TokenManager;
20
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EStoreManager = void 0;
4
- const json_schema_manager_1 = require("./json-schema-manager");
5
- const blacklist_manager_1 = require("./blacklist-manager");
6
- const whitelist_manager_1 = require("./whitelist-manager");
7
- const token_policy_manager_1 = require("./token-policy-manager");
8
- const token_manager_1 = require("./token-manager");
9
- class EStoreManager {
10
- constructor(options) {
11
- this.options = options;
12
- this.JsonSchema = new json_schema_manager_1.JsonSchemaManager(this.options);
13
- this.Blacklist = new blacklist_manager_1.BlacklistManager(this.options);
14
- this.Whitelist = new whitelist_manager_1.WhitelistManager(this.options);
15
- this.TokenPolicy = new token_policy_manager_1.TokenPolicyManager(this.options);
16
- this.Token = new token_manager_1.TokenManager(this.options);
17
- }
18
- }
19
- exports.EStoreManager = EStoreManager;
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manager/index.ts"],"names":[],"mappings":";;;AAAA,+DAAyD;AACzD,2DAAsD;AACtD,2DAAsD;AACtD,iEAA2D;AAC3D,mDAA8C;AAS9C,MAAa,aAAa;IACxB,YAAoB,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;QAElD,eAAU,GAAG,IAAI,uCAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChD,cAAS,GAAG,IAAI,oCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9C,cAAS,GAAG,IAAI,oCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9C,gBAAW,GAAG,IAAI,yCAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAClD,UAAK,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IANe,CAAC;CAOvD;AARD,sCAQC"}
@@ -1,8 +0,0 @@
1
- import { Json } from 'justypes';
2
- import { IEStoreManagerRequestOptions, EStoreManagerBase } from './base';
3
- export declare class JsonSchemaManager extends EStoreManagerBase {
4
- getNamespaces(options?: IEStoreManagerRequestOptions): Promise<string[]>;
5
- get(namespace: string, options?: IEStoreManagerRequestOptions): Promise<unknown>;
6
- set(namespace: string, schema: Json, options?: IEStoreManagerRequestOptions): Promise<void>;
7
- remove(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
8
- }
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.JsonSchemaManager = void 0;
13
- const extra_fetch_1 = require("extra-fetch");
14
- const extra_request_1 = require("extra-request");
15
- const index_js_1 = require("extra-request/transformers/index.js");
16
- const extra_response_1 = require("extra-response");
17
- const base_1 = require("./base");
18
- class JsonSchemaManager extends base_1.EStoreManagerBase {
19
- getNamespaces(options = {}) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/estore-with-json-schema'));
22
- return yield (0, extra_fetch_1.fetch)(req)
23
- .then(extra_response_1.ok)
24
- .then(extra_response_1.toJSON);
25
- });
26
- }
27
- get(namespace, options = {}) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/json-schema`));
30
- return yield (0, extra_fetch_1.fetch)(req)
31
- .then(extra_response_1.ok)
32
- .then(extra_response_1.toJSON);
33
- });
34
- }
35
- set(namespace, schema, options = {}) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/json-schema`), (0, index_js_1.json)(schema));
38
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
39
- });
40
- }
41
- remove(namespace, options = {}) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/json-schema`));
44
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
45
- });
46
- }
47
- }
48
- exports.JsonSchemaManager = JsonSchemaManager;
49
- //# sourceMappingURL=json-schema-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-schema-manager.js","sourceRoot":"","sources":["../../../src/manager/json-schema-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmC;AAEnC,iDAA6C;AAC7C,kEAA0E;AAC1E,mDAA2C;AAC3C,iCAAwE;AAExE,MAAa,iBAAkB,SAAQ,wBAAiB;IAIhD,aAAa,CAAC,UAAwC,EAAE;;YAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,gCAAgC,CAAC,CACjD,CAAA;YAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;iBACpB,IAAI,CAAC,mBAAE,CAAC;iBACR,IAAI,CAAC,uBAAM,CAAa,CAAA;QAC7B,CAAC;KAAA;IAKK,GAAG,CAAC,SAAiB,EAAE,UAAwC,EAAE;;YACrE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,cAAc,CAAC,CACzD,CAAA;YAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;iBACpB,IAAI,CAAC,mBAAE,CAAC;iBACR,IAAI,CAAC,uBAAM,CAAC,CAAA;QACjB,CAAC;KAAA;IAKK,GAAG,CACP,SAAiB,EACjB,MAAY,EACZ,UAAwC,EAAE;;YAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,cAAc,CAAC,EACxD,IAAA,eAAI,EAAC,MAAM,CAAC,CACb,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;IAKK,MAAM,CACV,SAAiB,EACjB,UAAwC,EAAE;;YAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,cAAc,CAAC,CACzD,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;CACF;AA5DD,8CA4DC"}
@@ -1,18 +0,0 @@
1
- import { IEStoreManagerRequestOptions, EStoreManagerBase } from './base';
2
- interface ITokenInfo {
3
- token: string;
4
- write: boolean;
5
- read: boolean;
6
- delete: boolean;
7
- }
8
- export declare class TokenManager extends EStoreManagerBase {
9
- getNamespaces(options?: IEStoreManagerRequestOptions): Promise<string[]>;
10
- getTokens(namespace: string, options?: IEStoreManagerRequestOptions): Promise<ITokenInfo[]>;
11
- addWriteToken(namespace: string, token: string, options?: IEStoreManagerRequestOptions): Promise<void>;
12
- removeWriteToken(namespace: string, token: string, options?: IEStoreManagerRequestOptions): Promise<void>;
13
- addReadToken(namespace: string, token: string, options?: IEStoreManagerRequestOptions): Promise<void>;
14
- removeReadToken(namespace: string, token: string, options?: IEStoreManagerRequestOptions): Promise<void>;
15
- addDeleteToken(namespace: string, token: string, options?: IEStoreManagerRequestOptions): Promise<void>;
16
- removeDeleteToken(namespace: string, token: string, options?: IEStoreManagerRequestOptions): Promise<void>;
17
- }
18
- export {};
@@ -1,73 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TokenManager = void 0;
13
- const extra_fetch_1 = require("extra-fetch");
14
- const extra_request_1 = require("extra-request");
15
- const index_js_1 = require("extra-request/transformers/index.js");
16
- const extra_response_1 = require("extra-response");
17
- const base_1 = require("./base");
18
- class TokenManager extends base_1.EStoreManagerBase {
19
- getNamespaces(options = {}) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/estore-with-tokens'));
22
- return yield (0, extra_fetch_1.fetch)(req)
23
- .then(extra_response_1.ok)
24
- .then(extra_response_1.toJSON);
25
- });
26
- }
27
- getTokens(namespace, options = {}) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens`));
30
- return yield (0, extra_fetch_1.fetch)(req)
31
- .then(extra_response_1.ok)
32
- .then(extra_response_1.toJSON);
33
- });
34
- }
35
- addWriteToken(namespace, token, options = {}) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/write`));
38
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
39
- });
40
- }
41
- removeWriteToken(namespace, token, options = {}) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/write`));
44
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
45
- });
46
- }
47
- addReadToken(namespace, token, options = {}) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/read`));
50
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
51
- });
52
- }
53
- removeReadToken(namespace, token, options = {}) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/read`));
56
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
57
- });
58
- }
59
- addDeleteToken(namespace, token, options = {}) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/delete`));
62
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
63
- });
64
- }
65
- removeDeleteToken(namespace, token, options = {}) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/delete`));
68
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
69
- });
70
- }
71
- }
72
- exports.TokenManager = TokenManager;
73
- //# sourceMappingURL=token-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../../src/manager/token-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmC;AACnC,iDAA6C;AAC7C,kEAAoE;AACpE,mDAA2C;AAC3C,iCAAwE;AASxE,MAAa,YAAa,SAAQ,wBAA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CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;CACF;AA/HD,oCA+HC"}
@@ -1,17 +0,0 @@
1
- import { IEStoreManagerRequestOptions, EStoreManagerBase } from './base';
2
- interface ITokenPolicy {
3
- writeTokenRequired: boolean | null;
4
- readTokenRequired: boolean | null;
5
- deleteTokenRequired: boolean | null;
6
- }
7
- export declare class TokenPolicyManager extends EStoreManagerBase {
8
- getNamespaces(options?: IEStoreManagerRequestOptions): Promise<string[]>;
9
- get(namespace: string, options?: IEStoreManagerRequestOptions): Promise<ITokenPolicy>;
10
- setWriteTokenRequired(namespace: string, val: boolean, options?: IEStoreManagerRequestOptions): Promise<void>;
11
- removeWriteTokenRequired(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
12
- setReadTokenRequired(namespace: string, val: boolean, options?: IEStoreManagerRequestOptions): Promise<void>;
13
- removeReadTokenRequired(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
14
- setDeleteTokenRequired(namespace: string, val: boolean, options?: IEStoreManagerRequestOptions): Promise<void>;
15
- removeDeleteTokenRequired(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
16
- }
17
- export {};
@@ -1,73 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TokenPolicyManager = void 0;
13
- const extra_fetch_1 = require("extra-fetch");
14
- const extra_request_1 = require("extra-request");
15
- const index_js_1 = require("extra-request/transformers/index.js");
16
- const extra_response_1 = require("extra-response");
17
- const base_1 = require("./base");
18
- class TokenPolicyManager extends base_1.EStoreManagerBase {
19
- getNamespaces(options = {}) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/estore-with-token-policies'));
22
- return yield (0, extra_fetch_1.fetch)(req)
23
- .then(extra_response_1.ok)
24
- .then(extra_response_1.toJSON);
25
- });
26
- }
27
- get(namespace, options = {}) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies`));
30
- return yield (0, extra_fetch_1.fetch)(req)
31
- .then(extra_response_1.ok)
32
- .then(extra_response_1.toJSON);
33
- });
34
- }
35
- setWriteTokenRequired(namespace, val, options = {}) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/write-token-required`), (0, index_js_1.json)(val));
38
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
39
- });
40
- }
41
- removeWriteTokenRequired(namespace, options = {}) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/write-token-required`));
44
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
45
- });
46
- }
47
- setReadTokenRequired(namespace, val, options = {}) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/read-token-required`), (0, index_js_1.json)(val));
50
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
51
- });
52
- }
53
- removeReadTokenRequired(namespace, options = {}) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/read-token-required`));
56
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
57
- });
58
- }
59
- setDeleteTokenRequired(namespace, val, options = {}) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/delete-token-required`), (0, index_js_1.json)(val));
62
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
63
- });
64
- }
65
- removeDeleteTokenRequired(namespace, options = {}) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/delete-token-required`));
68
- yield (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
69
- });
70
- }
71
- }
72
- exports.TokenPolicyManager = TokenPolicyManager;
73
- //# sourceMappingURL=token-policy-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-policy-manager.js","sourceRoot":"","sources":["../../../src/manager/token-policy-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmC;AACnC,iDAA6C;AAC7C,kEAA0E;AAC1E,mDAA2C;AAC3C,iCAAwE;AAQxE,MAAa,kBAAmB,SAAQ,wBAAiB;IAIjD,aAAa,CAAC,UAAwC,EAAE;;YAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,mCAAmC,CAAC,CACpD,CAAA;YAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;iBACpB,IAAI,CAAC,mBAAE,CAAC;iBACR,IAAI,CAAC,uBAAM,CAAa,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,EAAC,GAAG,CAAC,CACV,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;IAKK,uBAAuB,CAC3B,SAAiB,EACjB,UAAwC,EAAE;;YAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,qCAAqC,CAAC,CAChF,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;IAKK,sBAAsB,CAC1B,SAAiB,EACjB,GAAY,EACZ,UAAwC,EAAE;;YAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,uCAAuC,CAAC,EACjF,IAAA,eAAI,EAAC,GAAG,CAAC,CACV,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;IAKK,yBAAyB,CAC7B,SAAiB,EACjB,UAAwC,EAAE;;YAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,uCAAuC,CAAC,CAClF,CAAA;YAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;QAC3B,CAAC;KAAA;CACF;AA/HD,gDA+HC"}
@@ -1,6 +0,0 @@
1
- import { IEStoreManagerRequestOptions, EStoreManagerBase } from './base';
2
- export declare class WhitelistManager extends EStoreManagerBase {
3
- getNamespaces(options?: IEStoreManagerRequestOptions): Promise<string[]>;
4
- add(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
5
- remove(namespace: string, options?: IEStoreManagerRequestOptions): Promise<void>;
6
- }