@blackglory/estore-js 0.2.4 → 0.3.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 (84) hide show
  1. package/README.md +1 -1
  2. package/lib/{es2015/client.d.ts → client.d.ts} +0 -0
  3. package/lib/client.js +106 -0
  4. package/lib/client.js.map +1 -0
  5. package/lib/index.d.ts +2 -0
  6. package/lib/index.js +3 -0
  7. package/lib/index.js.map +1 -0
  8. package/lib/{es2015/manager → manager}/base.d.ts +3 -3
  9. package/lib/manager/base.js +22 -0
  10. package/lib/manager/base.js.map +1 -0
  11. package/lib/{es2018/manager → manager}/blacklist-manager.d.ts +1 -1
  12. package/lib/manager/blacklist-manager.js +22 -0
  13. package/lib/manager/blacklist-manager.js.map +1 -0
  14. package/lib/{es2015/manager → manager}/index.d.ts +5 -5
  15. package/lib/manager/index.js +16 -0
  16. package/lib/manager/index.js.map +1 -0
  17. package/lib/{es2018/manager → manager}/json-schema-manager.d.ts +3 -3
  18. package/lib/manager/json-schema-manager.js +28 -0
  19. package/lib/manager/json-schema-manager.js.map +1 -0
  20. package/lib/{es2018/manager → manager}/token-manager.d.ts +1 -1
  21. package/lib/manager/token-manager.js +44 -0
  22. package/lib/manager/token-manager.js.map +1 -0
  23. package/lib/{es2018/manager → manager}/token-policy-manager.d.ts +1 -1
  24. package/lib/manager/token-policy-manager.js +44 -0
  25. package/lib/manager/token-policy-manager.js.map +1 -0
  26. package/lib/{es2015/manager → manager}/whitelist-manager.d.ts +1 -1
  27. package/lib/manager/whitelist-manager.js +22 -0
  28. package/lib/manager/whitelist-manager.js.map +1 -0
  29. package/lib/utils.d.ts +1 -0
  30. package/lib/utils.js +2 -0
  31. package/lib/utils.js.map +1 -0
  32. package/package.json +39 -33
  33. package/lib/es2015/client.js +0 -139
  34. package/lib/es2015/client.js.map +0 -1
  35. package/lib/es2015/index.d.ts +0 -2
  36. package/lib/es2015/index.js +0 -15
  37. package/lib/es2015/index.js.map +0 -1
  38. package/lib/es2015/manager/base.js +0 -26
  39. package/lib/es2015/manager/base.js.map +0 -1
  40. package/lib/es2015/manager/blacklist-manager.d.ts +0 -6
  41. package/lib/es2015/manager/blacklist-manager.js +0 -41
  42. package/lib/es2015/manager/blacklist-manager.js.map +0 -1
  43. package/lib/es2015/manager/index.js +0 -20
  44. package/lib/es2015/manager/index.js.map +0 -1
  45. package/lib/es2015/manager/json-schema-manager.d.ts +0 -8
  46. package/lib/es2015/manager/json-schema-manager.js +0 -49
  47. package/lib/es2015/manager/json-schema-manager.js.map +0 -1
  48. package/lib/es2015/manager/token-manager.d.ts +0 -18
  49. package/lib/es2015/manager/token-manager.js +0 -73
  50. package/lib/es2015/manager/token-manager.js.map +0 -1
  51. package/lib/es2015/manager/token-policy-manager.d.ts +0 -17
  52. package/lib/es2015/manager/token-policy-manager.js +0 -73
  53. package/lib/es2015/manager/token-policy-manager.js.map +0 -1
  54. package/lib/es2015/manager/whitelist-manager.js +0 -41
  55. package/lib/es2015/manager/whitelist-manager.js.map +0 -1
  56. package/lib/es2015/utils.d.ts +0 -1
  57. package/lib/es2015/utils.js +0 -5
  58. package/lib/es2015/utils.js.map +0 -1
  59. package/lib/es2018/client.d.ts +0 -41
  60. package/lib/es2018/client.js +0 -110
  61. package/lib/es2018/client.js.map +0 -1
  62. package/lib/es2018/index.d.ts +0 -2
  63. package/lib/es2018/index.js +0 -15
  64. package/lib/es2018/index.js.map +0 -1
  65. package/lib/es2018/manager/base.d.ts +0 -13
  66. package/lib/es2018/manager/base.js +0 -26
  67. package/lib/es2018/manager/base.js.map +0 -1
  68. package/lib/es2018/manager/blacklist-manager.js +0 -26
  69. package/lib/es2018/manager/blacklist-manager.js.map +0 -1
  70. package/lib/es2018/manager/index.d.ts +0 -20
  71. package/lib/es2018/manager/index.js +0 -20
  72. package/lib/es2018/manager/index.js.map +0 -1
  73. package/lib/es2018/manager/json-schema-manager.js +0 -32
  74. package/lib/es2018/manager/json-schema-manager.js.map +0 -1
  75. package/lib/es2018/manager/token-manager.js +0 -48
  76. package/lib/es2018/manager/token-manager.js.map +0 -1
  77. package/lib/es2018/manager/token-policy-manager.js +0 -48
  78. package/lib/es2018/manager/token-policy-manager.js.map +0 -1
  79. package/lib/es2018/manager/whitelist-manager.d.ts +0 -6
  80. package/lib/es2018/manager/whitelist-manager.js +0 -26
  81. package/lib/es2018/manager/whitelist-manager.js.map +0 -1
  82. package/lib/es2018/utils.d.ts +0 -1
  83. package/lib/es2018/utils.js +0 -5
  84. package/lib/es2018/utils.js.map +0 -1
@@ -1,41 +0,0 @@
1
- interface IInfo {
2
- namespace: string;
3
- items: number;
4
- }
5
- export interface IEStoreClientOptions {
6
- server: string;
7
- token?: string;
8
- basicAuth?: {
9
- username: string;
10
- password: string;
11
- };
12
- keepalive?: boolean;
13
- timeout?: number;
14
- }
15
- export interface IEStoreClientRequestOptions {
16
- signal?: AbortSignal;
17
- token?: string;
18
- keepalive?: boolean;
19
- timeout?: number | false;
20
- }
21
- export interface IEStoreClientRequestOptionsWithoutToken {
22
- signal?: AbortSignal;
23
- keepalive?: boolean;
24
- timeout?: number | false;
25
- }
26
- export declare class EStoreClient {
27
- private options;
28
- constructor(options: IEStoreClientOptions);
29
- private getCommonTransformers;
30
- append<T>(namespace: string, itemId: string, payload: T, index?: number, options?: IEStoreClientRequestOptions): Promise<void>;
31
- getEvent<T>(namespace: string, itemId: string, index: number, options?: IEStoreClientRequestOptions): Promise<T | undefined>;
32
- getEvents<T>(namespace: string, itemId: string, options?: IEStoreClientRequestOptions): Promise<T[] | undefined>;
33
- getSize(namespace: string, itemId: string, options?: IEStoreClientRequestOptions): Promise<number>;
34
- has(namespace: string, itemId: string, options?: IEStoreClientRequestOptions): Promise<boolean>;
35
- del(namespace: string, itemId: string, options?: IEStoreClientRequestOptions): Promise<void>;
36
- clear(namespace: string, options?: IEStoreClientRequestOptions): Promise<void>;
37
- getAllItemIds(namespace: string, options?: IEStoreClientRequestOptions): Promise<string[]>;
38
- getAllNamespaces(options?: IEStoreClientRequestOptionsWithoutToken): Promise<string[]>;
39
- stats(namespace: string, options?: IEStoreClientRequestOptionsWithoutToken): Promise<IInfo>;
40
- }
41
- export {};
@@ -1,110 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EStoreClient = void 0;
4
- const extra_fetch_1 = require("extra-fetch");
5
- const extra_request_1 = require("extra-request");
6
- const index_js_1 = require("extra-request/transformers/index.js");
7
- const http_status_1 = require("@blackglory/http-status");
8
- const extra_response_1 = require("extra-response");
9
- const extra_abort_1 = require("extra-abort");
10
- const types_1 = require("@blackglory/types");
11
- const utils_1 = require("./utils");
12
- class EStoreClient {
13
- constructor(options) {
14
- this.options = options;
15
- }
16
- getCommonTransformers(options) {
17
- var _a, _b, _c;
18
- const token = 'token' in options
19
- ? ((_a = options.token) !== null && _a !== void 0 ? _a : this.options.token)
20
- : this.options.token;
21
- const auth = this.options.basicAuth;
22
- return [
23
- (0, index_js_1.url)(this.options.server),
24
- auth && (0, index_js_1.basicAuth)(auth.username, auth.password),
25
- token && (0, index_js_1.searchParams)({ token }),
26
- (0, index_js_1.signal)((0, extra_abort_1.raceAbortSignals)([
27
- options.signal,
28
- 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)))
29
- ])),
30
- ((_c = options.keepalive) !== null && _c !== void 0 ? _c : this.options.keepalive) && (0, index_js_1.keepalive)(),
31
- (0, index_js_1.header)('Accept-Version', utils_1.expectedVersion)
32
- ];
33
- }
34
- async append(namespace, itemId, payload, index, options = {}) {
35
- 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));
36
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
37
- }
38
- async getEvent(namespace, itemId, index, options = {}) {
39
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/events/${index}`));
40
- try {
41
- return await (0, extra_fetch_1.fetch)(req)
42
- .then(extra_response_1.ok)
43
- .then(extra_response_1.toJSON);
44
- }
45
- catch (e) {
46
- if (e instanceof http_status_1.NotFound)
47
- return undefined;
48
- throw e;
49
- }
50
- }
51
- async getEvents(namespace, itemId, options = {}) {
52
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/events`));
53
- try {
54
- return await (0, extra_fetch_1.fetch)(req)
55
- .then(extra_response_1.ok)
56
- .then(extra_response_1.toJSON);
57
- }
58
- catch (e) {
59
- if (e instanceof http_status_1.NotFound)
60
- return undefined;
61
- throw e;
62
- }
63
- }
64
- async getSize(namespace, itemId, options = {}) {
65
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}/size`));
66
- return await (0, extra_fetch_1.fetch)(req)
67
- .then(extra_response_1.ok)
68
- .then(extra_response_1.toJSON);
69
- }
70
- async has(namespace, itemId, options = {}) {
71
- const req = (0, extra_request_1.head)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}`));
72
- try {
73
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
74
- return true;
75
- }
76
- catch (e) {
77
- if (e instanceof http_status_1.NotFound)
78
- return false;
79
- throw e;
80
- }
81
- }
82
- async del(namespace, itemId, options = {}) {
83
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items/${itemId}`));
84
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
85
- }
86
- async clear(namespace, options = {}) {
87
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}`));
88
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
89
- }
90
- async getAllItemIds(namespace, options = {}) {
91
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/items`));
92
- return await (0, extra_fetch_1.fetch)(req)
93
- .then(extra_response_1.ok)
94
- .then(extra_response_1.toJSON);
95
- }
96
- async getAllNamespaces(options = {}) {
97
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/estore'));
98
- return await (0, extra_fetch_1.fetch)(req)
99
- .then(extra_response_1.ok)
100
- .then(extra_response_1.toJSON);
101
- }
102
- async stats(namespace, options = {}) {
103
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/estore/${namespace}/stats`));
104
- return await (0, extra_fetch_1.fetch)(req)
105
- .then(extra_response_1.ok)
106
- .then(extra_response_1.toJSON);
107
- }
108
- }
109
- exports.EStoreClient = EStoreClient;
110
- //# 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;QAE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B,UAAuC,EAAE;QAEzC,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,WAAW,SAAS,QAAQ,CAAC,CAC7C,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAa,CAAA;IAC7B,CAAC;IAKD,KAAK,CAAC,gBAAgB,CACpB,UAAmD,EAAE;QAErD,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,SAAS,CAAC,CAC1B,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAa,CAAA;IAC7B,CAAC;IAKD,KAAK,CAAC,KAAK,CACT,SAAiB,EACjB,UAAmD,EAAE;QAErD,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,WAAW,SAAS,QAAQ,CAAC,CAC7C,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAU,CAAA;IAC1B,CAAC;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,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlacklistManager = void 0;
4
- const extra_fetch_1 = require("extra-fetch");
5
- const extra_request_1 = require("extra-request");
6
- const index_js_1 = require("extra-request/transformers/index.js");
7
- const extra_response_1 = require("extra-response");
8
- const base_1 = require("./base");
9
- class BlacklistManager extends base_1.EStoreManagerBase {
10
- async getNamespaces(options = {}) {
11
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/blacklist'));
12
- return await (0, extra_fetch_1.fetch)(req)
13
- .then(extra_response_1.ok)
14
- .then(extra_response_1.toJSON);
15
- }
16
- async add(namespace, options = {}) {
17
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/blacklist/${namespace}`));
18
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
19
- }
20
- async remove(namespace, options = {}) {
21
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/blacklist/${namespace}`));
22
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
23
- }
24
- }
25
- exports.BlacklistManager = BlacklistManager;
26
- //# 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;IAIrD,KAAK,CAAC,aAAa,CAAC,UAAwC,EAAE;QAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,kBAAkB,CAAC,CACnC,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAa,CAAA;IAC7B,CAAC;IAKD,KAAK,CAAC,GAAG,CAAC,SAAiB,EAAE,UAAwC,EAAE;QACrE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,oBAAoB,SAAS,EAAE,CAAC,CAChD,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;IAKD,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,UAAwC,EAAE;QACxE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,oBAAoB,SAAS,EAAE,CAAC,CAChD,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;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,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonSchemaManager = void 0;
4
- const extra_fetch_1 = require("extra-fetch");
5
- const extra_request_1 = require("extra-request");
6
- const index_js_1 = require("extra-request/transformers/index.js");
7
- const extra_response_1 = require("extra-response");
8
- const base_1 = require("./base");
9
- class JsonSchemaManager extends base_1.EStoreManagerBase {
10
- async getNamespaces(options = {}) {
11
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/estore-with-json-schema'));
12
- return await (0, extra_fetch_1.fetch)(req)
13
- .then(extra_response_1.ok)
14
- .then(extra_response_1.toJSON);
15
- }
16
- async get(namespace, options = {}) {
17
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/json-schema`));
18
- return await (0, extra_fetch_1.fetch)(req)
19
- .then(extra_response_1.ok)
20
- .then(extra_response_1.toJSON);
21
- }
22
- async set(namespace, schema, options = {}) {
23
- 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));
24
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
25
- }
26
- async remove(namespace, options = {}) {
27
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/json-schema`));
28
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
29
- }
30
- }
31
- exports.JsonSchemaManager = JsonSchemaManager;
32
- //# 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;IAItD,KAAK,CAAC,aAAa,CAAC,UAAwC,EAAE;QAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,gCAAgC,CAAC,CACjD,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAa,CAAA;IAC7B,CAAC;IAKD,KAAK,CAAC,GAAG,CAAC,SAAiB,EAAE,UAAwC,EAAE;QACrE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,cAAc,CAAC,CACzD,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAC,CAAA;IACjB,CAAC;IAKD,KAAK,CAAC,GAAG,CACP,SAAiB,EACjB,MAAY,EACZ,UAAwC,EAAE;QAE1C,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;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;IAKD,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,UAAwC,EAAE;QAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,cAAc,CAAC,CACzD,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;CACF;AA5DD,8CA4DC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokenManager = void 0;
4
- const extra_fetch_1 = require("extra-fetch");
5
- const extra_request_1 = require("extra-request");
6
- const index_js_1 = require("extra-request/transformers/index.js");
7
- const extra_response_1 = require("extra-response");
8
- const base_1 = require("./base");
9
- class TokenManager extends base_1.EStoreManagerBase {
10
- async getNamespaces(options = {}) {
11
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/estore-with-tokens'));
12
- return await (0, extra_fetch_1.fetch)(req)
13
- .then(extra_response_1.ok)
14
- .then(extra_response_1.toJSON);
15
- }
16
- async getTokens(namespace, options = {}) {
17
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens`));
18
- return await (0, extra_fetch_1.fetch)(req)
19
- .then(extra_response_1.ok)
20
- .then(extra_response_1.toJSON);
21
- }
22
- async addWriteToken(namespace, token, options = {}) {
23
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/write`));
24
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
25
- }
26
- async removeWriteToken(namespace, token, options = {}) {
27
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/write`));
28
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
29
- }
30
- async addReadToken(namespace, token, options = {}) {
31
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/read`));
32
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
33
- }
34
- async removeReadToken(namespace, token, options = {}) {
35
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/read`));
36
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
37
- }
38
- async addDeleteToken(namespace, token, options = {}) {
39
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/delete`));
40
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
41
- }
42
- async removeDeleteToken(namespace, token, options = {}) {
43
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/tokens/${token}/delete`));
44
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
45
- }
46
- }
47
- exports.TokenManager = TokenManager;
48
- //# 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,wBAAiB;IAIjD,KAAK,CAAC,aAAa,CAAC,UAAwC,EAAE;QAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,2BAA2B,CAAC,CAC5C,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAa,CAAA;IAC7B,CAAC;IAKD,KAAK,CAAC,SAAS,CACb,SAAiB,EACjB,UAAwC,EAAE;QAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,SAAS,CAAC,CACpD,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAiB,CAAA;IACjC,CAAC;IAKD,KAAK,CAAC,aAAa,CACjB,SAAiB,EACjB,KAAa,EACb,UAAwC,EAAE;QAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,WAAW,KAAK,QAAQ,CAAC,CACnE,CAAA;QAED,MAAM,IA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C,iBAAiB,SAAS,WAAW,KAAK,SAAS,CAAC,CACpE,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;IAKD,KAAK,CAAC,iBAAiB,CACrB,SAAiB,EACjB,KAAa,EACb,UAAwC,EAAE;QAE1C,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,WAAW,KAAK,SAAS,CAAC,CACpE,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;CACF;AA/HD,oCA+HC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokenPolicyManager = void 0;
4
- const extra_fetch_1 = require("extra-fetch");
5
- const extra_request_1 = require("extra-request");
6
- const index_js_1 = require("extra-request/transformers/index.js");
7
- const extra_response_1 = require("extra-response");
8
- const base_1 = require("./base");
9
- class TokenPolicyManager extends base_1.EStoreManagerBase {
10
- async getNamespaces(options = {}) {
11
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/estore-with-token-policies'));
12
- return await (0, extra_fetch_1.fetch)(req)
13
- .then(extra_response_1.ok)
14
- .then(extra_response_1.toJSON);
15
- }
16
- async get(namespace, options = {}) {
17
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies`));
18
- return await (0, extra_fetch_1.fetch)(req)
19
- .then(extra_response_1.ok)
20
- .then(extra_response_1.toJSON);
21
- }
22
- async setWriteTokenRequired(namespace, val, options = {}) {
23
- 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));
24
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
25
- }
26
- async removeWriteTokenRequired(namespace, options = {}) {
27
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/write-token-required`));
28
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
29
- }
30
- async setReadTokenRequired(namespace, val, options = {}) {
31
- 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));
32
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
33
- }
34
- async removeReadTokenRequired(namespace, options = {}) {
35
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/read-token-required`));
36
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
37
- }
38
- async setDeleteTokenRequired(namespace, val, options = {}) {
39
- 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));
40
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
41
- }
42
- async removeDeleteTokenRequired(namespace, options = {}) {
43
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/estore/${namespace}/token-policies/delete-token-required`));
44
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
45
- }
46
- }
47
- exports.TokenPolicyManager = TokenPolicyManager;
48
- //# 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,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,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,iBAAiB,SAAS,uCAAuC,CAAC,CAClF,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;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
- }
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WhitelistManager = void 0;
4
- const extra_fetch_1 = require("extra-fetch");
5
- const extra_request_1 = require("extra-request");
6
- const index_js_1 = require("extra-request/transformers/index.js");
7
- const extra_response_1 = require("extra-response");
8
- const base_1 = require("./base");
9
- class WhitelistManager extends base_1.EStoreManagerBase {
10
- async getNamespaces(options = {}) {
11
- const req = (0, extra_request_1.get)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)('/admin/whitelist'));
12
- return await (0, extra_fetch_1.fetch)(req)
13
- .then(extra_response_1.ok)
14
- .then(extra_response_1.toJSON);
15
- }
16
- async add(namespace, options = {}) {
17
- const req = (0, extra_request_1.put)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/whitelist/${namespace}`));
18
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
19
- }
20
- async remove(namespace, options = {}) {
21
- const req = (0, extra_request_1.del)(...this.getCommonTransformers(options), (0, index_js_1.appendPathname)(`/admin/whitelist/${namespace}`));
22
- await (0, extra_fetch_1.fetch)(req).then(extra_response_1.ok);
23
- }
24
- }
25
- exports.WhitelistManager = WhitelistManager;
26
- //# sourceMappingURL=whitelist-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitelist-manager.js","sourceRoot":"","sources":["../../../src/manager/whitelist-manager.ts"],"names":[],"mappings":";;;AAAA,6CAAmC;AACnC,iDAA6C;AAC7C,kEAAoE;AACpE,mDAA2C;AAC3C,iCAAwE;AAExE,MAAa,gBAAiB,SAAQ,wBAAiB;IAIrD,KAAK,CAAC,aAAa,CAAC,UAAwC,EAAE;QAC5D,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,kBAAkB,CAAC,CACnC,CAAA;QAED,OAAO,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC;aACpB,IAAI,CAAC,mBAAE,CAAC;aACR,IAAI,CAAC,uBAAM,CAAa,CAAA;IAC7B,CAAC;IAKD,KAAK,CAAC,GAAG,CAAC,SAAiB,EAAE,UAAwC,EAAE;QACrE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,oBAAoB,SAAS,EAAE,CAAC,CAChD,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;IAKD,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,UAAwC,EAAE;QACxE,MAAM,GAAG,GAAG,IAAA,mBAAG,EACb,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtC,IAAA,yBAAc,EAAC,oBAAoB,SAAS,EAAE,CAAC,CAChD,CAAA;QAED,MAAM,IAAA,mBAAK,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAE,CAAC,CAAA;IAC3B,CAAC;CACF;AAtCD,4CAsCC"}
@@ -1 +0,0 @@
1
- export declare const expectedVersion = "0.1.0";
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expectedVersion = void 0;
4
- exports.expectedVersion = '0.1.0';
5
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,OAAO,CAAA"}