montycat 1.0.2

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,284 @@
1
+ import net from 'net';
2
+ import JSONbigBase from 'json-bigint';
3
+ const JSONbig = JSONbigBase({ storeAsString: true });
4
+ /** * Enum for valid permissions.
5
+ * @enum
6
+ * */
7
+ var ValidPermissions;
8
+ (function (ValidPermissions) {
9
+ ValidPermissions["READ"] = "read";
10
+ ValidPermissions["WRITE"] = "write";
11
+ ValidPermissions["ALL"] = "all";
12
+ })(ValidPermissions || (ValidPermissions = {}));
13
+ /**
14
+ * Represents the configuration and connection details for a communication engine.
15
+ * This class allows you to connect to a MontyCat server and perform operations such as creating stores, managing owners, and granting/revoking permissions.
16
+ * @class
17
+ * @param {EngineConfig} config - The configuration for the engine, including host, port, username, password, and store.
18
+ * @example
19
+ *
20
+ * const engine = new Engine({
21
+ * host: 'localhost',
22
+ * port: 3000,
23
+ * username: 'admin',
24
+ * password: 'admin',
25
+ * store: 'test_store',
26
+ * });
27
+ *
28
+ */
29
+ class Engine {
30
+ host;
31
+ port;
32
+ username;
33
+ password;
34
+ store;
35
+ constructor({ host = null, port = null, username = null, password = null, store = null } = {}) {
36
+ this.host = host;
37
+ this.port = port;
38
+ this.username = username;
39
+ this.password = password;
40
+ this.store = store;
41
+ }
42
+ /**
43
+ * Creates an Engine instance from a URI string in the format:
44
+ * montycat://host/port/username/password[/store]
45
+ */
46
+ static fromUri(uri) {
47
+ if (!uri.startsWith('montycat://')) {
48
+ throw new Error("URI must use 'montycat://' protocol");
49
+ }
50
+ const parts = uri.slice('montycat://'.length).split('/');
51
+ if (parts.length !== 4 && parts.length !== 5) {
52
+ throw new Error('Missing or extra parts in URI');
53
+ }
54
+ const [host, portStr, username, password, store = null] = parts;
55
+ if (!host || !portStr || !username || !password) {
56
+ throw new Error('Host, port, username, and password must be non-empty');
57
+ }
58
+ const port = parseInt(portStr, 10);
59
+ if (isNaN(port)) {
60
+ throw new Error('Port must be an integer');
61
+ }
62
+ return new Engine({ host, port, username, password, store });
63
+ }
64
+ /**
65
+ * Creates a store with the specified persistence option.
66
+ * @param {Object} options - Options for creating the store.
67
+ * @param {boolean} [options.persistent=false] - Whether to create a persistent store.
68
+ * @returns {Promise<unknown>} A promise that resolves with the result of the store creation.
69
+ */
70
+ async createStore({ persistent = false } = {}) {
71
+ const rawQuery = {
72
+ raw: ['create-store', 'store', this.store, 'persistent', persistent ? 'y' : 'n'],
73
+ credentials: [this.username, this.password],
74
+ };
75
+ return sendData(this.host, this.port, JSONbig.stringify(rawQuery));
76
+ }
77
+ /**
78
+ * Removes a store with the specified persistence option.
79
+ * @param {Object} options - Options for removing the store.
80
+ * @param {boolean} [options.persistent=false] - Whether to remove a persistent store.
81
+ * @returns {Promise<unknown>} A promise that resolves with the result of the store removal.
82
+ */
83
+ async removeStore({ persistent = false } = {}) {
84
+ const rawQuery = {
85
+ raw: ['remove-store', 'store', this.store, 'persistent', persistent ? 'y' : 'n'],
86
+ credentials: [this.username, this.password],
87
+ };
88
+ return sendData(this.host, this.port, JSONbig.stringify(rawQuery));
89
+ }
90
+ /**
91
+ * Creates an owner with the specified username and password.
92
+ * @param {string} owner - The username of the owner to create.
93
+ * @param {string} password - The password for the owner.
94
+ * @returns {Promise<unknown>} A promise that resolves with the result of the owner creation.
95
+ */
96
+ async createOwner(owner, password) {
97
+ const rawQuery = {
98
+ raw: ['create-owner', 'username', owner, 'password', password],
99
+ credentials: [this.username, this.password],
100
+ };
101
+ return sendData(this.host, this.port, JSONbig.stringify(rawQuery));
102
+ }
103
+ async removeOwner(owner) {
104
+ const rawQuery = {
105
+ raw: ['remove-owner', 'username', owner],
106
+ credentials: [this.username, this.password],
107
+ };
108
+ return sendData(this.host, this.port, JSONbig.stringify(rawQuery));
109
+ }
110
+ /**
111
+ * Lists all owners in the store.
112
+ * @returns {Promise<unknown>} A promise that resolves with the list of owners.
113
+ */
114
+ async listOwners() {
115
+ const rawQuery = {
116
+ raw: ['list-owners'],
117
+ credentials: [this.username, this.password],
118
+ };
119
+ return sendData(this.host, this.port, JSONbig.stringify(rawQuery));
120
+ }
121
+ /**
122
+ * Grants a permission to an owner for specified keyspaces.
123
+ * @param {string} owner - The username of the owner to grant permission to.
124
+ * @param {ValidPermissions} permission - The permission to grant (read, write, all).
125
+ * @param {string | GenericKV[] | string[] | { keyspace: string }} [keyspaces] - The keyspaces to grant permission for.
126
+ * @returns {Promise<unknown>} A promise that resolves with the result of the grant operation.
127
+ */
128
+ async grantTo(owner, permission, keyspaces) {
129
+ const query = {
130
+ raw: ['grant-to', 'owner', owner, 'permission', permission, 'store', this.store],
131
+ credentials: [this.username, this.password],
132
+ };
133
+ if (keyspaces) {
134
+ query.raw.push('keyspaces');
135
+ if (typeof keyspaces === 'string') {
136
+ query.raw.push(keyspaces);
137
+ }
138
+ else if (Array.isArray(keyspaces)) {
139
+ keyspaces.forEach(each => {
140
+ if (typeof each === 'object' && each.hasOwnProperty('keyspace')) {
141
+ query.raw.push(each.keyspace);
142
+ }
143
+ else if (typeof each === 'string') {
144
+ query.raw.push(each);
145
+ }
146
+ });
147
+ }
148
+ else if (typeof keyspaces === 'object' && keyspaces.hasOwnProperty('keyspace')) {
149
+ query.raw.push(keyspaces.keyspace);
150
+ }
151
+ }
152
+ return sendData(this.host, this.port, JSONbig.stringify(query));
153
+ }
154
+ /**
155
+ * Revokes a permission from an owner for specified keyspaces.
156
+ * @param {string} owner - The username of the owner to revoke permission from.
157
+ * @param {ValidPermissions} permission - The permission to revoke (read, write, all).
158
+ * @param {string | GenericKV[] | string[] | { keyspace: string }} [keyspaces] - The keyspaces to revoke permission for.
159
+ * @returns {Promise<unknown>} A promise that resolves with the result of the revoke operation.
160
+ */
161
+ async revokeFrom(owner, permission, keyspaces) {
162
+ const validPermissions = ['read', 'write', 'all'];
163
+ if (!validPermissions.includes(permission)) {
164
+ throw new Error(`Invalid permission: ${permission}. Valid permissions are: ${validPermissions}`);
165
+ }
166
+ const query = {
167
+ raw: ['revoke-from', 'owner', owner, 'permission', permission, 'store', this.store],
168
+ credentials: [this.username, this.password],
169
+ };
170
+ if (keyspaces) {
171
+ query.raw.push('keyspaces');
172
+ if (typeof keyspaces === 'string') {
173
+ query.raw.push(keyspaces);
174
+ }
175
+ else if (Array.isArray(keyspaces)) {
176
+ keyspaces.forEach(each => {
177
+ if (typeof each === 'object' && each.hasOwnProperty('keyspace')) {
178
+ query.raw.push(each.keyspace);
179
+ }
180
+ else if (typeof each === 'string') {
181
+ query.raw.push(each);
182
+ }
183
+ });
184
+ }
185
+ else if (typeof keyspaces === 'object' && keyspaces.hasOwnProperty('keyspace')) {
186
+ query.raw.push(keyspaces.keyspace);
187
+ }
188
+ }
189
+ return sendData(this.host, this.port, JSONbig.stringify(query));
190
+ }
191
+ /**
192
+ * Retrieves the structure of the store.
193
+ * @returns {Promise<unknown>} A promise that resolves with the structure of the store
194
+ * */
195
+ async getStructureAvailable() {
196
+ const rawQuery = {
197
+ raw: ['get-structure-available'],
198
+ credentials: [this.username, this.password],
199
+ };
200
+ return sendData(this.host, this.port, JSONbig.stringify(rawQuery));
201
+ }
202
+ }
203
+ /**
204
+ * Sends a string to the specified host and port, and returns the parsed response.
205
+ * @param {string} host - The host to connect to.
206
+ * @param {number} port - The port to connect to.
207
+ * @param {string} string - The string to send.
208
+ * @returns {Promise<unknown>} A promise that resolves with the parsed response.
209
+ */
210
+ async function sendData(host, port, string) {
211
+ return new Promise((resolve) => {
212
+ const client = new net.Socket({
213
+ readable: true,
214
+ writable: true,
215
+ });
216
+ let response = '';
217
+ client.connect(port, host, () => {
218
+ client.write(string + '\n');
219
+ });
220
+ client.on('data', (data) => {
221
+ response += data.toString();
222
+ if (response.includes('\n')) {
223
+ try {
224
+ const parsedResponse = recursiveParseJSON(response);
225
+ client.destroy();
226
+ resolve(parsedResponse);
227
+ }
228
+ catch (err) {
229
+ // Ignore parsing errors for now; handled in 'end' event
230
+ }
231
+ }
232
+ });
233
+ client.on('end', () => {
234
+ try {
235
+ const parsedResponse = recursiveParseJSON(response);
236
+ resolve(parsedResponse);
237
+ }
238
+ catch (err) {
239
+ resolve('Incomplete or invalid response');
240
+ }
241
+ });
242
+ client.on('timeout', () => {
243
+ resolve('Operation timed out');
244
+ client.destroy();
245
+ });
246
+ client.on('error', (err) => {
247
+ resolve(`Connection error: ${err.message}`);
248
+ client.destroy();
249
+ });
250
+ client.setTimeout(120000);
251
+ });
252
+ }
253
+ /**
254
+ * Recursively parses JSON data, handling BigInt and other types.
255
+ * @param {unknown} data - The data to parse.
256
+ * @returns {unknown} The parsed data.
257
+ */
258
+ function recursiveParseJSON(data) {
259
+ if (typeof data === 'string') {
260
+ if (/^\d+$/.test(data) && BigInt(data) <= 18446744073709551615n) {
261
+ return data;
262
+ }
263
+ try {
264
+ const parsedData = JSONbig.parse(data);
265
+ return recursiveParseJSON(parsedData);
266
+ }
267
+ catch {
268
+ return data;
269
+ }
270
+ }
271
+ else if (Array.isArray(data)) {
272
+ return data.map((item) => recursiveParseJSON(item));
273
+ }
274
+ else if (typeof data === 'object' && data !== null) {
275
+ return Object.fromEntries(Object.entries(data).map(([key, value]) => {
276
+ const parsedKey = isNaN(parseInt(key, 10)) ? key : parseInt(key, 10);
277
+ return [parsedKey, recursiveParseJSON(value)];
278
+ }));
279
+ }
280
+ else {
281
+ return data;
282
+ }
283
+ }
284
+ export { Engine, sendData, ValidPermissions };
@@ -0,0 +1,98 @@
1
+ import GenericKV from '../classes/generic.js';
2
+ /**
3
+ * InMemory class that extends GenericKV for in-memory keyspace operations.
4
+ * It provides methods for inserting, updating, and retrieving data in an in-memory store.
5
+ */
6
+ declare class InMemory extends GenericKV {
7
+ static persistent: boolean;
8
+ static distributed: boolean;
9
+ /**
10
+ * Creates a keyspace in the in-memory store.
11
+ * @returns A promise that resolves with the result of the keyspace creation.
12
+ */
13
+ static createKeyspace(): Promise<any>;
14
+ /**
15
+ * Snapshots the current state of the in-memory keyspace.
16
+ * @returns A promise that resolves with the result of the snapshot operation.
17
+ */
18
+ static doSnapshotsForKeyspace(): Promise<any>;
19
+ /**
20
+ * Cleans up snapshots for the in-memory keyspace.
21
+ * @returns A promise that resolves with the result of the cleanup operation.
22
+ */
23
+ static cleanSnapshotsForKeyspace(): Promise<any>;
24
+ /**
25
+ * Stops snapshots for the in-memory keyspace.
26
+ * @returns A promise that resolves with the result of stopping snapshots.
27
+ */
28
+ static stopSnapshotsForKeyspace(): Promise<any>;
29
+ /**
30
+ * Inserts a value into the in-memory store.
31
+ * @param value - The value to insert.
32
+ * @param expireSec - The expiration time in seconds for the value.
33
+ * @return A promise that resolves with the result of the insertion.
34
+ * */
35
+ static insertValue({ value, expireSec }?: {
36
+ value?: any;
37
+ expireSec?: number;
38
+ }): Promise<any>;
39
+ /**
40
+ * Inserts a custom key into the in-memory store.
41
+ * @param customKey - The custom key for the value.
42
+ * @param expireSec - The expiration time in seconds for the value.
43
+ * @return A promise that resolves with the result of the insertion.
44
+ */
45
+ static insertCustomKey({ customKey, expireSec }: {
46
+ customKey: string;
47
+ expireSec?: number;
48
+ }): Promise<any>;
49
+ /**
50
+ * Inserts a custom key-value pair into the in-memory store.
51
+ * @param customKey - The custom key for the value.
52
+ * @param value - The value to insert.
53
+ * @param expireSec - The expiration time in seconds for the value.
54
+ * @return A promise that resolves with the result of the insertion.
55
+ */
56
+ static insertCustomKeyValue({ customKey, value, expireSec }: {
57
+ customKey: string;
58
+ value?: any;
59
+ expireSec?: number;
60
+ }): Promise<any>;
61
+ /**
62
+ * Updates a value in the in-memory store.
63
+ * @param key - The key for the value to update.
64
+ * @param customKey - The custom key for the value to update.
65
+ * @param value - The new value to set.
66
+ * @param expireSec - The expiration time in seconds for the value.
67
+ * @return A promise that resolves with the result of the update.
68
+ */
69
+ static updateValue({ key, customKey, value, expireSec }?: {
70
+ key?: string;
71
+ customKey?: string | null;
72
+ value?: any;
73
+ expireSec?: number;
74
+ }): Promise<any>;
75
+ /**
76
+ * Inserts a bulk of values into the in-memory store.
77
+ * @param bulk - An array of values to insert.
78
+ * @param expireSec - The expiration time in seconds for the values.
79
+ * @return A promise that resolves with the result of the insertion.
80
+ */
81
+ static insertBulk({ bulk, expireSec }?: {
82
+ bulk?: any[];
83
+ expireSec?: number;
84
+ }): Promise<any>;
85
+ /**
86
+ * Gets keys from the in-memory store.
87
+ * @returns A promise that resolves with the retrieved keys.
88
+ */
89
+ static getKeys(): Promise<any>;
90
+ }
91
+ /**
92
+ * InMemoryDistributed class that extends InMemory for distributed in-memory keyspace operations.
93
+ * It provides methods for distributed operations in an in-memory store.
94
+ */
95
+ declare class InMemoryDistributed extends InMemory {
96
+ static distributed: boolean;
97
+ }
98
+ export { InMemory, InMemoryDistributed };
@@ -0,0 +1,150 @@
1
+ import { runQuery, convertToBinaryQuery, convertCustomKey } from '../functions/storeGenericFunctions.js';
2
+ import GenericKV from '../classes/generic.js';
3
+ /**
4
+ * InMemory class that extends GenericKV for in-memory keyspace operations.
5
+ * It provides methods for inserting, updating, and retrieving data in an in-memory store.
6
+ */
7
+ class InMemory extends GenericKV {
8
+ static persistent = false;
9
+ static distributed = false;
10
+ /**
11
+ * Creates a keyspace in the in-memory store.
12
+ * @returns A promise that resolves with the result of the keyspace creation.
13
+ */
14
+ static async createKeyspace() {
15
+ const query = {
16
+ raw: ["create-keyspace", "store", this.store, "keyspace", this.keyspace, "persistent", this.persistent ? "y" : "n"],
17
+ credentials: [this.username, this.password],
18
+ };
19
+ return await runQuery(this, JSON.stringify(query));
20
+ }
21
+ /**
22
+ * Snapshots the current state of the in-memory keyspace.
23
+ * @returns A promise that resolves with the result of the snapshot operation.
24
+ */
25
+ static async doSnapshotsForKeyspace() {
26
+ if (this.persistent) {
27
+ throw new Error("Snapshots are not allowed on persistent keyspaces");
28
+ }
29
+ const query = {
30
+ raw: ["do-snapshots-for-keyspace", "store", this.store, "keyspace", this.keyspace, "persistent", "n"],
31
+ credentials: [this.username, this.password],
32
+ };
33
+ return runQuery(this, JSON.stringify(query));
34
+ }
35
+ /**
36
+ * Cleans up snapshots for the in-memory keyspace.
37
+ * @returns A promise that resolves with the result of the cleanup operation.
38
+ */
39
+ static async cleanSnapshotsForKeyspace() {
40
+ if (this.persistent) {
41
+ throw new Error("Snapshots are not allowed on persistent keyspaces");
42
+ }
43
+ const query = {
44
+ raw: ["clean-snapshots-for-keyspace", "store", this.store, "keyspace", this.keyspace, "persistent", "n"],
45
+ credentials: [this.username, this.password],
46
+ };
47
+ return runQuery(this, JSON.stringify(query));
48
+ }
49
+ /**
50
+ * Stops snapshots for the in-memory keyspace.
51
+ * @returns A promise that resolves with the result of stopping snapshots.
52
+ */
53
+ static async stopSnapshotsForKeyspace() {
54
+ if (this.persistent) {
55
+ throw new Error("Snapshots are not allowed on persistent keyspaces");
56
+ }
57
+ const query = {
58
+ raw: ["stop-snapshots-for-keyspace", "store", this.store, "keyspace", this.keyspace, "persistent", "n"],
59
+ credentials: [this.username, this.password],
60
+ };
61
+ return runQuery(this, JSON.stringify(query));
62
+ }
63
+ /**
64
+ * Inserts a value into the in-memory store.
65
+ * @param value - The value to insert.
66
+ * @param expireSec - The expiration time in seconds for the value.
67
+ * @return A promise that resolves with the result of the insertion.
68
+ * */
69
+ static async insertValue({ value = {}, expireSec = 0 } = {}) {
70
+ this.command = "insert_value";
71
+ const query = convertToBinaryQuery(this, { value, expireSec });
72
+ return runQuery(this, query);
73
+ }
74
+ /**
75
+ * Inserts a custom key into the in-memory store.
76
+ * @param customKey - The custom key for the value.
77
+ * @param expireSec - The expiration time in seconds for the value.
78
+ * @return A promise that resolves with the result of the insertion.
79
+ */
80
+ static async insertCustomKey({ customKey, expireSec = 0 }) {
81
+ if (!customKey) {
82
+ throw new Error("No key provided");
83
+ }
84
+ this.command = "insert_custom_key";
85
+ const query = convertToBinaryQuery(this, { key: convertCustomKey(customKey), expireSec });
86
+ return runQuery(this, query);
87
+ }
88
+ /**
89
+ * Inserts a custom key-value pair into the in-memory store.
90
+ * @param customKey - The custom key for the value.
91
+ * @param value - The value to insert.
92
+ * @param expireSec - The expiration time in seconds for the value.
93
+ * @return A promise that resolves with the result of the insertion.
94
+ */
95
+ static async insertCustomKeyValue({ customKey, value = {}, expireSec = 0 }) {
96
+ this.command = "insert_custom_key_value";
97
+ const query = convertToBinaryQuery(this, { key: convertCustomKey(customKey), value, expireSec });
98
+ return runQuery(this, query);
99
+ }
100
+ /**
101
+ * Updates a value in the in-memory store.
102
+ * @param key - The key for the value to update.
103
+ * @param customKey - The custom key for the value to update.
104
+ * @param value - The new value to set.
105
+ * @param expireSec - The expiration time in seconds for the value.
106
+ * @return A promise that resolves with the result of the update.
107
+ */
108
+ static async updateValue({ key = "", customKey = null, value = {}, expireSec = 0 } = {}) {
109
+ const effectiveKey = customKey ? convertCustomKey(customKey) : key;
110
+ if (!effectiveKey) {
111
+ throw new Error("No key provided");
112
+ }
113
+ this.command = "update_value";
114
+ const query = convertToBinaryQuery(this, { key: effectiveKey, value, expireSec });
115
+ return runQuery(this, query);
116
+ }
117
+ /**
118
+ * Inserts a bulk of values into the in-memory store.
119
+ * @param bulk - An array of values to insert.
120
+ * @param expireSec - The expiration time in seconds for the values.
121
+ * @return A promise that resolves with the result of the insertion.
122
+ */
123
+ static async insertBulk({ bulk = [], expireSec = 0 } = {}) {
124
+ if (!bulk || bulk.length === 0) {
125
+ throw new Error("No values provided");
126
+ }
127
+ this.command = "insert_bulk";
128
+ const query = convertToBinaryQuery(this, { bulkValues: bulk, expireSec });
129
+ return runQuery(this, query);
130
+ }
131
+ /**
132
+ * Gets keys from the in-memory store.
133
+ * @returns A promise that resolves with the retrieved keys.
134
+ */
135
+ static async getKeys() {
136
+ this.command = "get_keys";
137
+ const query = convertToBinaryQuery(this);
138
+ return runQuery(this, query);
139
+ }
140
+ }
141
+ ;
142
+ /**
143
+ * InMemoryDistributed class that extends InMemory for distributed in-memory keyspace operations.
144
+ * It provides methods for distributed operations in an in-memory store.
145
+ */
146
+ class InMemoryDistributed extends InMemory {
147
+ static distributed = true;
148
+ }
149
+ ;
150
+ export { InMemory, InMemoryDistributed };
@@ -0,0 +1,98 @@
1
+ import GenericKV from '../classes/generic.js';
2
+ /**
3
+ * Persistent class that extends GenericKV for persistent keyspace operations.
4
+ * It provides methods for inserting, updating, and retrieving data in a persistent store.
5
+ */
6
+ declare class Persistent extends GenericKV {
7
+ static persistent: boolean;
8
+ static distributed: boolean;
9
+ static cache: number | null;
10
+ static compression: boolean;
11
+ keyspace: string;
12
+ constructor(options: {
13
+ keyspace: string;
14
+ username: string;
15
+ password: string;
16
+ [key: string]: any;
17
+ });
18
+ /**
19
+ * Inserts a value into the persistent store.
20
+ * @param value - The value to insert.
21
+ * @return A promise that resolves with the result of the insertion.
22
+ */
23
+ static insertValue({ value }?: {
24
+ value?: any;
25
+ }): Promise<any>;
26
+ /**
27
+ * Inserts a key-value pair into the persistent store.
28
+ * @param key - The key for the value.
29
+ * @param value - The value to insert.
30
+ * @return A promise that resolves with the result of the insertion.
31
+ */
32
+ static insertCustomKey({ customKey }: {
33
+ customKey: string;
34
+ }): Promise<any>;
35
+ /**
36
+ * Inserts a custom key-value pair into the persistent store.
37
+ * @param customKey - The custom key for the value.
38
+ * @param value - The value to insert.
39
+ * @return A promise that resolves with the result of the insertion.
40
+ */
41
+ static insertCustomKeyValue({ customKey, value }: {
42
+ customKey: string;
43
+ value?: any;
44
+ }): Promise<any>;
45
+ /**
46
+ * Updates a value in the persistent store.
47
+ * @param key - The key for the value to update.
48
+ * @param customKey - The custom key for the value to update.
49
+ * @param value - The new value to set.
50
+ * @return A promise that resolves with the result of the update.
51
+ */
52
+ static updateValue({ key, customKey, value }?: {
53
+ key?: string;
54
+ customKey?: string | null;
55
+ value?: any;
56
+ }): Promise<any>;
57
+ /**
58
+ * Retrieves a value from the persistent store.
59
+ * @param key - The key for the value to retrieve.
60
+ * @param customKey - The custom key for the value to retrieve.
61
+ * @return A promise that resolves with the retrieved value.
62
+ */
63
+ static insertBulk({ bulk }?: {
64
+ bulk?: any[];
65
+ }): Promise<any>;
66
+ /**
67
+ * Retrieves a value from the persistent store.
68
+ * @param key - The key for the value to retrieve.
69
+ * @param customKey - The custom key for the value to retrieve.
70
+ * @return A promise that resolves with the retrieved value.
71
+ */
72
+ static getKeys({ limitOutput }?: {
73
+ limitOutput?: {
74
+ start: number;
75
+ stop: number;
76
+ };
77
+ }): Promise<any>;
78
+ /**
79
+ * Updates the cache and compression settings for the persistent store.
80
+ * @param cache - The cache settings to apply.
81
+ * @param compression - Whether to enable compression.
82
+ * @return A promise that resolves with the result of the update.
83
+ */
84
+ static updateCacheAndCompression(): Promise<any>;
85
+ /**
86
+ * Creates a keyspace in the persistent store.
87
+ * @return A promise that resolves with the result of the keyspace creation.
88
+ */
89
+ static createKeyspace(): Promise<any>;
90
+ }
91
+ /**
92
+ * PersistentDistributed class that extends Persistent for distributed persistent keyspace operations.
93
+ * It provides methods for distributed operations in a persistent store.
94
+ */
95
+ declare class PersistentDistributed extends Persistent {
96
+ static distributed: boolean;
97
+ }
98
+ export { Persistent, PersistentDistributed };