@gomomento/sdk-core 1.12.8
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.
- package/dist/src/auth/credential-provider.d.ts +83 -0
- package/dist/src/auth/credential-provider.js +82 -0
- package/dist/src/auth/index.d.ts +1 -0
- package/dist/src/auth/index.js +18 -0
- package/dist/src/config/logging/default-momento-logger.d.ts +24 -0
- package/dist/src/config/logging/default-momento-logger.js +69 -0
- package/dist/src/config/logging/index.d.ts +3 -0
- package/dist/src/config/logging/index.js +20 -0
- package/dist/src/config/logging/momento-logger.d.ts +10 -0
- package/dist/src/config/logging/momento-logger.js +3 -0
- package/dist/src/config/logging/noop-momento-logger.d.ts +11 -0
- package/dist/src/config/logging/noop-momento-logger.js +34 -0
- package/dist/src/config/transport/grpc-configuration.d.ts +41 -0
- package/dist/src/config/transport/grpc-configuration.js +3 -0
- package/dist/src/config/transport/index.d.ts +2 -0
- package/dist/src/config/transport/index.js +19 -0
- package/dist/src/config/transport/transport-strategy.d.ts +77 -0
- package/dist/src/config/transport/transport-strategy.js +60 -0
- package/dist/src/errors/error-utils.d.ts +2 -0
- package/dist/src/errors/error-utils.js +12 -0
- package/dist/src/errors/errors.d.ts +140 -0
- package/dist/src/errors/errors.js +229 -0
- package/dist/src/errors/index.d.ts +2 -0
- package/dist/src/errors/index.js +19 -0
- package/dist/src/index.d.ts +57 -0
- package/dist/src/index.js +137 -0
- package/dist/src/internal/clients/auth/AbstractAuthClient.d.ts +10 -0
- package/dist/src/internal/clients/auth/AbstractAuthClient.js +13 -0
- package/dist/src/internal/clients/auth/IAuthClient.d.ts +4 -0
- package/dist/src/internal/clients/auth/IAuthClient.js +3 -0
- package/dist/src/internal/clients/auth/index.d.ts +2 -0
- package/dist/src/internal/clients/auth/index.js +19 -0
- package/dist/src/internal/clients/cache/AbstractCacheClient.d.ts +638 -0
- package/dist/src/internal/clients/cache/AbstractCacheClient.js +870 -0
- package/dist/src/internal/clients/cache/ICacheClient.d.ts +45 -0
- package/dist/src/internal/clients/cache/ICacheClient.js +3 -0
- package/dist/src/internal/clients/cache/IControlClient.d.ts +7 -0
- package/dist/src/internal/clients/cache/IControlClient.js +3 -0
- package/dist/src/internal/clients/cache/IDataClient.d.ts +29 -0
- package/dist/src/internal/clients/cache/IDataClient.js +3 -0
- package/dist/src/internal/clients/cache/index.d.ts +4 -0
- package/dist/src/internal/clients/cache/index.js +21 -0
- package/dist/src/internal/clients/index.d.ts +3 -0
- package/dist/src/internal/clients/index.js +20 -0
- package/dist/src/internal/clients/ping/AbstractPingClient.d.ts +25 -0
- package/dist/src/internal/clients/ping/AbstractPingClient.js +29 -0
- package/dist/src/internal/clients/ping/IPingClient.d.ts +3 -0
- package/dist/src/internal/clients/ping/IPingClient.js +3 -0
- package/dist/src/internal/clients/ping/index.d.ts +2 -0
- package/dist/src/internal/clients/ping/index.js +19 -0
- package/dist/src/internal/subscription-state.d.ts +15 -0
- package/dist/src/internal/subscription-state.js +38 -0
- package/dist/src/internal/utils/auth.d.ts +25 -0
- package/dist/src/internal/utils/auth.js +50 -0
- package/dist/src/internal/utils/collections.d.ts +1 -0
- package/dist/src/internal/utils/collections.js +8 -0
- package/dist/src/internal/utils/display.d.ts +2 -0
- package/dist/src/internal/utils/display.js +30 -0
- package/dist/src/internal/utils/index.d.ts +7 -0
- package/dist/src/internal/utils/index.js +24 -0
- package/dist/src/internal/utils/object.d.ts +1 -0
- package/dist/src/internal/utils/object.js +8 -0
- package/dist/src/internal/utils/sleep.d.ts +1 -0
- package/dist/src/internal/utils/sleep.js +6 -0
- package/dist/src/internal/utils/string.d.ts +2 -0
- package/dist/src/internal/utils/string.js +17 -0
- package/dist/src/internal/utils/validators.d.ts +13 -0
- package/dist/src/internal/utils/validators.js +105 -0
- package/dist/src/internal/vendor/printf/README.md +31 -0
- package/dist/src/internal/vendor/printf/printf.d.ts +9 -0
- package/dist/src/internal/vendor/printf/printf.js +478 -0
- package/dist/src/messages/cache-info.d.ts +5 -0
- package/dist/src/messages/cache-info.js +13 -0
- package/dist/src/messages/responses/cache-delete.d.ts +61 -0
- package/dist/src/messages/responses/cache-delete.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-fetch.d.ts +120 -0
- package/dist/src/messages/responses/cache-dictionary-fetch.js +162 -0
- package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +123 -0
- package/dist/src/messages/responses/cache-dictionary-get-field.js +143 -0
- package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +122 -0
- package/dist/src/messages/responses/cache-dictionary-get-fields.js +173 -0
- package/dist/src/messages/responses/cache-dictionary-increment.d.ts +69 -0
- package/dist/src/messages/responses/cache-dictionary-increment.js +68 -0
- package/dist/src/messages/responses/cache-dictionary-remove-field.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-remove-field.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-remove-fields.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-remove-fields.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-set-field.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-set-field.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-set-fields.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-set-fields.js +54 -0
- package/dist/src/messages/responses/cache-flush.d.ts +61 -0
- package/dist/src/messages/responses/cache-flush.js +54 -0
- package/dist/src/messages/responses/cache-get.d.ts +86 -0
- package/dist/src/messages/responses/cache-get.js +88 -0
- package/dist/src/messages/responses/cache-increment.d.ts +69 -0
- package/dist/src/messages/responses/cache-increment.js +68 -0
- package/dist/src/messages/responses/cache-list-concatenate-back.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-concatenate-back.js +68 -0
- package/dist/src/messages/responses/cache-list-concatenate-front.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-concatenate-front.js +68 -0
- package/dist/src/messages/responses/cache-list-fetch.d.ts +92 -0
- package/dist/src/messages/responses/cache-list-fetch.js +96 -0
- package/dist/src/messages/responses/cache-list-length.d.ts +84 -0
- package/dist/src/messages/responses/cache-list-length.js +78 -0
- package/dist/src/messages/responses/cache-list-pop-back.d.ts +86 -0
- package/dist/src/messages/responses/cache-list-pop-back.js +88 -0
- package/dist/src/messages/responses/cache-list-pop-front.d.ts +86 -0
- package/dist/src/messages/responses/cache-list-pop-front.js +88 -0
- package/dist/src/messages/responses/cache-list-push-back.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-push-back.js +68 -0
- package/dist/src/messages/responses/cache-list-push-front.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-push-front.js +68 -0
- package/dist/src/messages/responses/cache-list-remove-value.d.ts +61 -0
- package/dist/src/messages/responses/cache-list-remove-value.js +54 -0
- package/dist/src/messages/responses/cache-list-retain.d.ts +61 -0
- package/dist/src/messages/responses/cache-list-retain.js +54 -0
- package/dist/src/messages/responses/cache-set-add-element.d.ts +71 -0
- package/dist/src/messages/responses/cache-set-add-element.js +54 -0
- package/dist/src/messages/responses/cache-set-add-elements.d.ts +65 -0
- package/dist/src/messages/responses/cache-set-add-elements.js +61 -0
- package/dist/src/messages/responses/cache-set-fetch.d.ts +111 -0
- package/dist/src/messages/responses/cache-set-fetch.js +121 -0
- package/dist/src/messages/responses/cache-set-if-not-exists.d.ts +74 -0
- package/dist/src/messages/responses/cache-set-if-not-exists.js +63 -0
- package/dist/src/messages/responses/cache-set-remove-element.d.ts +61 -0
- package/dist/src/messages/responses/cache-set-remove-element.js +54 -0
- package/dist/src/messages/responses/cache-set-remove-elements.d.ts +65 -0
- package/dist/src/messages/responses/cache-set-remove-elements.js +61 -0
- package/dist/src/messages/responses/cache-set.d.ts +61 -0
- package/dist/src/messages/responses/cache-set.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-fetch.d.ts +107 -0
- package/dist/src/messages/responses/cache-sorted-set-fetch.js +124 -0
- package/dist/src/messages/responses/cache-sorted-set-get-rank.d.ts +81 -0
- package/dist/src/messages/responses/cache-sorted-set-get-rank.js +78 -0
- package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +118 -0
- package/dist/src/messages/responses/cache-sorted-set-get-score.js +131 -0
- package/dist/src/messages/responses/cache-sorted-set-get-scores.d.ts +109 -0
- package/dist/src/messages/responses/cache-sorted-set-get-scores.js +148 -0
- package/dist/src/messages/responses/cache-sorted-set-increment-score.d.ts +69 -0
- package/dist/src/messages/responses/cache-sorted-set-increment-score.js +68 -0
- package/dist/src/messages/responses/cache-sorted-set-put-element.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-put-element.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-put-elements.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-put-elements.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-element.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-element.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-elements.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-elements.js +54 -0
- package/dist/src/messages/responses/create-cache.d.ts +77 -0
- package/dist/src/messages/responses/create-cache.js +61 -0
- package/dist/src/messages/responses/create-signing-key.d.ts +71 -0
- package/dist/src/messages/responses/create-signing-key.js +76 -0
- package/dist/src/messages/responses/delete-cache.d.ts +61 -0
- package/dist/src/messages/responses/delete-cache.js +54 -0
- package/dist/src/messages/responses/generate-api-token.d.ts +50 -0
- package/dist/src/messages/responses/generate-api-token.js +52 -0
- package/dist/src/messages/responses/grpc-response-types.d.ts +41 -0
- package/dist/src/messages/responses/grpc-response-types.js +53 -0
- package/dist/src/messages/responses/list-caches.d.ts +70 -0
- package/dist/src/messages/responses/list-caches.js +69 -0
- package/dist/src/messages/responses/list-signing-keys.d.ts +68 -0
- package/dist/src/messages/responses/list-signing-keys.js +68 -0
- package/dist/src/messages/responses/response-base.d.ts +43 -0
- package/dist/src/messages/responses/response-base.js +50 -0
- package/dist/src/messages/responses/revoke-signing-key.d.ts +61 -0
- package/dist/src/messages/responses/revoke-signing-key.js +54 -0
- package/dist/src/messages/responses/topic-item.d.ts +27 -0
- package/dist/src/messages/responses/topic-item.js +43 -0
- package/dist/src/messages/responses/topic-publish.d.ts +61 -0
- package/dist/src/messages/responses/topic-publish.js +54 -0
- package/dist/src/messages/responses/topic-subscribe.d.ts +69 -0
- package/dist/src/messages/responses/topic-subscribe.js +72 -0
- package/dist/src/messages/signing-key.d.ts +9 -0
- package/dist/src/messages/signing-key.js +21 -0
- package/dist/src/utils/cache-call-options.d.ts +99 -0
- package/dist/src/utils/cache-call-options.js +9 -0
- package/dist/src/utils/collection-ttl.d.ts +78 -0
- package/dist/src/utils/collection-ttl.js +102 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.js +20 -0
- package/dist/src/utils/topic-call-options.d.ts +19 -0
- package/dist/src/utils/topic-call-options.js +3 -0
- package/package.json +53 -0
@@ -0,0 +1,638 @@
|
|
1
|
+
import { CreateCache, DeleteCache, ListCaches, CacheFlush, CacheGet, CacheSet, CacheDelete, CacheIncrement, IncrementOptions, CacheSetIfNotExists, SetIfNotExistsOptions, CacheSetFetch, CacheSetAddElement, CacheSetAddElements, CacheSetRemoveElement, CacheSetRemoveElements, CacheListFetch, CacheListLength, CacheListPushFront, CacheListPushBack, CacheListConcatenateBack, CacheListConcatenateFront, CacheListPopBack, CacheListPopFront, CacheListRemoveValue, CacheListRetain, CacheDictionarySetField, CacheDictionarySetFields, CacheDictionaryGetField, CacheDictionaryGetFields, CacheDictionaryIncrement, CacheDictionaryFetch, CacheDictionaryRemoveField, CacheDictionaryRemoveFields } from '../../../index';
|
2
|
+
import { ListFetchCallOptions, ListRetainCallOptions } from '../../../utils';
|
3
|
+
import { ICacheClient, SetOptions, SetAddElementOptions, SetAddElementsOptions, ListPushFrontOptions, ListPushBackOptions, ListConcatenateBackOptions, ListConcatenateFrontOptions, DictionarySetFieldOptions, DictionaryIncrementOptions } from './ICacheClient';
|
4
|
+
import { IControlClient } from './IControlClient';
|
5
|
+
import { IDataClient } from './IDataClient';
|
6
|
+
export declare abstract class AbstractCacheClient implements ICacheClient {
|
7
|
+
protected readonly controlClient: IControlClient;
|
8
|
+
protected readonly dataClients: IDataClient[];
|
9
|
+
protected nextDataClientIndex: number;
|
10
|
+
constructor(controlClient: IControlClient, dataClients: IDataClient[]);
|
11
|
+
/**
|
12
|
+
* Creates a cache if it does not exist.
|
13
|
+
*
|
14
|
+
* @param {string} cacheName - The cache to be created.
|
15
|
+
* @returns {Promise<CreateCache.Response>} -
|
16
|
+
* {@link CreateCache.Success} on success.
|
17
|
+
* {@link CreateCache.AlreadyExists} if the cache already exists.
|
18
|
+
* {@link CreateCache.Error} on failure.
|
19
|
+
*/
|
20
|
+
createCache(cacheName: string): Promise<CreateCache.Response>;
|
21
|
+
/**
|
22
|
+
* Deletes a cache and all items stored in it.
|
23
|
+
*
|
24
|
+
* @param {string} cacheName - The cache to delete.
|
25
|
+
* @returns {Promise<DeleteCache.Response>} -
|
26
|
+
* {@link DeleteCache.Success} on success.
|
27
|
+
* {@link DeleteCache.Error} on failure.
|
28
|
+
*/
|
29
|
+
deleteCache(cacheName: string): Promise<DeleteCache.Response>;
|
30
|
+
/**
|
31
|
+
* Lists all caches.
|
32
|
+
*
|
33
|
+
* @returns {Promise<ListCaches.Response>} -
|
34
|
+
* {@link ListCaches.Success} containing the list on success.
|
35
|
+
* {@link ListCaches.Error} on failure.
|
36
|
+
*/
|
37
|
+
listCaches(): Promise<ListCaches.Response>;
|
38
|
+
/**
|
39
|
+
* Gets the value stored for the given key.
|
40
|
+
*
|
41
|
+
* @param {string} cacheName - The cache to perform the lookup in.
|
42
|
+
* @param {string | Uint8Array} key - The key to look up.
|
43
|
+
* @returns {Promise<CacheGet.Response>} -
|
44
|
+
* {@link CacheGet.Hit} containing the value if one is found.
|
45
|
+
* {@link CacheGet.Miss} if the key does not exist.
|
46
|
+
* {@link CacheGet.Error} on failure.
|
47
|
+
*/
|
48
|
+
get(cacheName: string, key: string | Uint8Array): Promise<CacheGet.Response>;
|
49
|
+
/**
|
50
|
+
* Associates the given key with the given value. If a value for the key is
|
51
|
+
* already present it is replaced with the new value.
|
52
|
+
*
|
53
|
+
* @param {string} cacheName - The cache to store the value in.
|
54
|
+
* @param {string | Uint8Array} key - The key to set.
|
55
|
+
* @param {string | Uint8Array} value - The value to be stored.
|
56
|
+
* @param {SetOptions} [options]
|
57
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
58
|
+
* Uses the client's default TTL if this is not supplied.
|
59
|
+
* @returns {Promise<CacheSet.Response>} -
|
60
|
+
* {@link CacheSet.Success} on success.
|
61
|
+
* {@link CacheSet.Error} on failure.
|
62
|
+
*/
|
63
|
+
set(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, options?: SetOptions): Promise<CacheSet.Response>;
|
64
|
+
/**
|
65
|
+
* Removes the given key from the cache. The key can represent a single value
|
66
|
+
* or a collection.
|
67
|
+
*
|
68
|
+
* @param {string} cacheName - The cache to delete from.
|
69
|
+
* @param {string | Uint8Array} key - The key to delete.
|
70
|
+
* @returns {Promise<CacheDelete.Response>} -
|
71
|
+
* {@link CacheDelete.Success} on success.
|
72
|
+
* {@link CacheDelete.Error} on failure.
|
73
|
+
*/
|
74
|
+
delete(cacheName: string, key: string | Uint8Array): Promise<CacheDelete.Response>;
|
75
|
+
/**
|
76
|
+
* Adds multiple elements to the back of the given list. Creates the list if
|
77
|
+
* it does not already exist.
|
78
|
+
*
|
79
|
+
* @param {string} cacheName - The cache to store the list in.
|
80
|
+
* @param {string} listName - The list to add to.
|
81
|
+
* @param {string[] | Uint8Array[]} values - The elements to add to the list.
|
82
|
+
* @param {ListConcatenateBackOptions} [options]
|
83
|
+
* @param {number} [options.truncateFrontToSize] - If the list exceeds this
|
84
|
+
* length, remove excess from the front of the list. Must be positive.
|
85
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
86
|
+
* Refreshes the list's TTL using the client's default if this is not
|
87
|
+
* supplied.
|
88
|
+
* @returns {Promise<CacheListConcatenateBack.Response>} -
|
89
|
+
* {@link CacheListConcatenateBack.Success} on success.
|
90
|
+
* {@link CacheListConcatenateBack.Error} on failure.
|
91
|
+
*/
|
92
|
+
listConcatenateBack(cacheName: string, listName: string, values: string[] | Uint8Array[], options?: ListConcatenateBackOptions): Promise<CacheListConcatenateBack.Response>;
|
93
|
+
/**
|
94
|
+
* Adds multiple elements to the front of the given list. Creates the list if
|
95
|
+
* it does not already exist.
|
96
|
+
*
|
97
|
+
* @param {string} cacheName - The cache to store the list in.
|
98
|
+
* @param {string} listName - The list to add to.
|
99
|
+
* @param {string[] | Uint8Array[]} values - The elements to add to the list.
|
100
|
+
* @param {ListConcatenateFrontOptions} [options]
|
101
|
+
* @param {number} [options.truncateBackToSize] - If the list exceeds this
|
102
|
+
* length, remove excess from the back of the list. Must be positive.
|
103
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
104
|
+
* Refreshes the list's TTL using the client's default if this is not
|
105
|
+
* supplied.
|
106
|
+
* @returns {Promise<CacheListConcatenateFront.Response>} -
|
107
|
+
* {@link CacheListConcatenateFront.Success} on success.
|
108
|
+
* {@link CacheListConcatenateFront.Error} on failure.
|
109
|
+
*/
|
110
|
+
listConcatenateFront(cacheName: string, listName: string, values: string[] | Uint8Array[], options?: ListConcatenateFrontOptions): Promise<CacheListConcatenateFront.Response>;
|
111
|
+
/**
|
112
|
+
* Fetches all elements of the given list.
|
113
|
+
*
|
114
|
+
* @param {string} cacheName - The cache containing the list.
|
115
|
+
* @param {string} listName - The list to fetch.
|
116
|
+
* @param {ListFetchCallOptions} [options]
|
117
|
+
* @param {number} [options.startIndex] - Start inclusive index for fetch operation.
|
118
|
+
* @param {number} [options.endIndex] - End exclusive index for fetch operation.
|
119
|
+
* @returns {Promise<CacheListFetch.Response>} -
|
120
|
+
* {@link CacheListFetch.Hit} containing the list elements if the list exists.
|
121
|
+
* {@link CacheListFetch.Miss} if the list does not exist.
|
122
|
+
* {@link CacheListFetch.Error} on failure.
|
123
|
+
*/
|
124
|
+
listFetch(cacheName: string, listName: string, options?: ListFetchCallOptions): Promise<CacheListFetch.Response>;
|
125
|
+
/**
|
126
|
+
* Gets the number of elements in the given list.
|
127
|
+
*
|
128
|
+
* @param {string} cacheName - The cache containing the list.
|
129
|
+
* @param {string} listName - The list to get the length of.
|
130
|
+
* @returns {Promise<CacheListLength.Response>} -
|
131
|
+
* {@link CacheListLength.Hit} containing the length if the list exists.
|
132
|
+
* {@link CacheListLength.Miss} if the list does not exist.
|
133
|
+
* {@link CacheListLength.Error} on failure.
|
134
|
+
*/
|
135
|
+
listLength(cacheName: string, listName: string): Promise<CacheListLength.Response>;
|
136
|
+
/**
|
137
|
+
* Gets and removes the last value from the given list.
|
138
|
+
*
|
139
|
+
* @param {string} cacheName - The cache containing the list.
|
140
|
+
* @param {string} listName - The list to pop.
|
141
|
+
* @returns {Promise<CacheListPopBack.Response>} -
|
142
|
+
* {@link CacheListPopBack.Hit} containing the element if the list exists.
|
143
|
+
* {@link CacheListPopBack.Miss} if the list does not exist.
|
144
|
+
* {@link CacheListPopBack.Error} on failure.
|
145
|
+
*/
|
146
|
+
listPopBack(cacheName: string, listName: string): Promise<CacheListPopBack.Response>;
|
147
|
+
/**
|
148
|
+
* Gets and removes the first value from the given list.
|
149
|
+
*
|
150
|
+
* @param {string} cacheName - The cache containing the list.
|
151
|
+
* @param {string} listName - The list to pop.
|
152
|
+
* @returns {Promise<CacheListPopFront.Response>} -
|
153
|
+
* {@link CacheListPopFront.Hit} containing the element if the list exists.
|
154
|
+
* {@link CacheListPopFront.Miss} if the list does not exist.
|
155
|
+
* {@link CacheListPopFront.Error} on failure.
|
156
|
+
*/
|
157
|
+
listPopFront(cacheName: string, listName: string): Promise<CacheListPopFront.Response>;
|
158
|
+
/**
|
159
|
+
* Adds an element to the back of the given list. Creates the list if
|
160
|
+
* it does not already exist.
|
161
|
+
*
|
162
|
+
* @param {string} cacheName - The cache to store the list in.
|
163
|
+
* @param {string} listName - The list to push to.
|
164
|
+
* @param {string | Uint8Array} value - The value to push.
|
165
|
+
* @param {ListPushBackOptions} [options]
|
166
|
+
* @param {number} [options.truncateFrontToSize] - If the list exceeds this
|
167
|
+
* length, remove excess from the front of the list. Must be positive.
|
168
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
169
|
+
* Refreshes the list's TTL using the client's default if this is not
|
170
|
+
* supplied.
|
171
|
+
* @returns {Promise<CacheListPushBack.Response>} -
|
172
|
+
* {@link CacheListPushBack.Success} containing the list's new length on
|
173
|
+
* success.
|
174
|
+
* {@link CacheListPushBack.Error} on failure.
|
175
|
+
*/
|
176
|
+
listPushBack(cacheName: string, listName: string, value: string | Uint8Array, options?: ListPushBackOptions): Promise<CacheListPushBack.Response>;
|
177
|
+
/**
|
178
|
+
* Adds an element to the front of the given list. Creates the list if
|
179
|
+
* it does not already exist.
|
180
|
+
*
|
181
|
+
* @param {string} cacheName - The cache to store the list in.
|
182
|
+
* @param {string} listName - The list to push to.
|
183
|
+
* @param {string | Uint8Array} value - The value to push.
|
184
|
+
* @param {ListPushFrontOptions} [options]
|
185
|
+
* @param {number} [options.truncateBackToSize] - If the list exceeds this
|
186
|
+
* length, remove excess from the end of the list. Must be positive.
|
187
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
188
|
+
* Refreshes the list's TTL using the client's default if this is not
|
189
|
+
* supplied.
|
190
|
+
* @returns {Promise<CacheListPushFront.Response>} -
|
191
|
+
* {@link CacheListPushFront.Success} containing the list's new length on
|
192
|
+
* success.
|
193
|
+
* {@link CacheListPushFront.Error} on failure.
|
194
|
+
*/
|
195
|
+
listPushFront(cacheName: string, listName: string, value: string | Uint8Array, options?: ListPushFrontOptions): Promise<CacheListPushFront.Response>;
|
196
|
+
/**
|
197
|
+
* Removes all elements from the given list equal to the given value.
|
198
|
+
*
|
199
|
+
* @param {string} cacheName - The cache containing the list.
|
200
|
+
* @param {string} listName - The list to remove from.
|
201
|
+
* @param {string | Uint8Array} value - The value to remove.
|
202
|
+
* @returns {Promise<CacheListRemoveValue.Response>} -
|
203
|
+
* {@link CacheListRemoveValue.Success} on success. Removing an element that
|
204
|
+
* does not occur in the list or removing from a non-existent list counts as a
|
205
|
+
* success.
|
206
|
+
* {@link CacheListRemoveValue.Error} on failure.
|
207
|
+
*/
|
208
|
+
listRemoveValue(cacheName: string, listName: string, value: string | Uint8Array): Promise<CacheListRemoveValue.Response>;
|
209
|
+
/**
|
210
|
+
* Retains slice of elements of a given list, deletes the rest of the list
|
211
|
+
* that isn't being retained. Returns a Success or Error.
|
212
|
+
*
|
213
|
+
* @param {string} cacheName - The cache containing the list.
|
214
|
+
* @param {string} listName - The list to retain a slice of.
|
215
|
+
* @param {ListRetainCallOptions} [options]
|
216
|
+
* @param {number} [options.startIndex] - Start inclusive index for fetch
|
217
|
+
* operation. Defaults to start of array if not given, 0.
|
218
|
+
* @param {number} [options.endIndex] - End exclusive index for fetch
|
219
|
+
* operation. Defaults to end of array if not given.
|
220
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
221
|
+
* Refreshes the list's TTL using the client's default if this is not
|
222
|
+
* supplied.
|
223
|
+
* @returns {Promise<CacheListRetain.Response>} -
|
224
|
+
* {@link CacheListRetain.Success} on success.
|
225
|
+
* {@link CacheListRetain.Error} on failure.
|
226
|
+
*/
|
227
|
+
listRetain(cacheName: string, listName: string, options?: ListRetainCallOptions): Promise<CacheListRetain.Response>;
|
228
|
+
/**
|
229
|
+
* Fetches all elements of the given set
|
230
|
+
*
|
231
|
+
* @param {string} cacheName - The cache containing the set.
|
232
|
+
* @param {string} setName - The set to fetch.
|
233
|
+
* @returns {Promise<CacheSetFetch.Response>} -
|
234
|
+
* {@link CacheSetFetch.Hit} containing the set elements if the set exists.
|
235
|
+
* {@link CacheSetFetch.Miss} if the set does not exist.
|
236
|
+
* {@link CacheSetFetch.Error} on failure.
|
237
|
+
*/
|
238
|
+
setFetch(cacheName: string, setName: string): Promise<CacheSetFetch.Response>;
|
239
|
+
/**
|
240
|
+
* Adds an element to the given set. Creates the set if it does not already
|
241
|
+
* exist.
|
242
|
+
*
|
243
|
+
* @remarks
|
244
|
+
* After this operation the set will contain the union of the element passed
|
245
|
+
* in and the original elements of the set.
|
246
|
+
*
|
247
|
+
* @param {string} cacheName - The cache to store the set in.
|
248
|
+
* @param {string} setName - The set to add to.
|
249
|
+
* @param {string | Uint8Array} element - The element to add.
|
250
|
+
* @param {SetAddElementOptions} options
|
251
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
252
|
+
* Refreshes the set's TTL using the client's default if this is not supplied.
|
253
|
+
* @returns {Promise<CacheSetAddElement.Response>} -
|
254
|
+
* {@link CacheSetAddElement.Success} on success.
|
255
|
+
* {@link CacheSetAddElement.Error} on failure.
|
256
|
+
*/
|
257
|
+
setAddElement(cacheName: string, setName: string, element: string | Uint8Array, options?: SetAddElementOptions): Promise<CacheSetAddElement.Response>;
|
258
|
+
/**
|
259
|
+
* Adds multiple elements to the given set. Creates the set if it does not
|
260
|
+
* already exist.
|
261
|
+
*
|
262
|
+
* @remarks
|
263
|
+
* After this operation, the set will contain the union of the elements passed
|
264
|
+
* in and the original elements of the set.
|
265
|
+
*
|
266
|
+
* @param {string} cacheName - The cache to store the set in.
|
267
|
+
* @param {string} setName - The set to add to.
|
268
|
+
* @param {string[] | Uint8Array[]} elements - The elements to add.
|
269
|
+
* @param {SetAddElementsOptions} options
|
270
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
271
|
+
* Refreshes the set's TTL using the client's default if this is not supplied.
|
272
|
+
* @returns {Promise<CacheSetAddElements.Response>} -
|
273
|
+
* {@link CacheSetAddElements.Success} on success.
|
274
|
+
* {@link CacheSetAddElements.Error} on failure.
|
275
|
+
*/
|
276
|
+
setAddElements(cacheName: string, setName: string, elements: string[] | Uint8Array[], options?: SetAddElementsOptions): Promise<CacheSetAddElements.Response>;
|
277
|
+
/**
|
278
|
+
* Removes an element from the given set.
|
279
|
+
*
|
280
|
+
* @param {string} cacheName - The cache containing the set.
|
281
|
+
* @param {string} setName - The set to remove from.
|
282
|
+
* @param {string | Uint8Array} element - The element to remove.
|
283
|
+
* @returns {Promise<CacheSetRemoveElement.Response>} -
|
284
|
+
* {@link CacheSetRemoveElement.Success} on success. Removing an element that
|
285
|
+
* does not occur in the set or removing from a non-existent set counts as a
|
286
|
+
* success.
|
287
|
+
* {@link CacheSetRemoveElement.Error} on failure.
|
288
|
+
*/
|
289
|
+
setRemoveElement(cacheName: string, setName: string, element: string | Uint8Array): Promise<CacheSetRemoveElement.Response>;
|
290
|
+
/**
|
291
|
+
* Removes multiple elements from the given set.
|
292
|
+
*
|
293
|
+
* @param {string} cacheName - The cache containing the set.
|
294
|
+
* @param {string} setName - The set to remove from.
|
295
|
+
* @param {string[] | Uint8Array[]} elements - The elements to remove.
|
296
|
+
* @returns {Promise<CacheSetRemoveElements.Response>} -
|
297
|
+
* {@link CacheSetRemoveElements.Success} on success. Removing elements that
|
298
|
+
* do not occur in the set or removing from a non-existent set counts as a
|
299
|
+
* success.
|
300
|
+
* {@link CacheSetRemoveElements.Error} on failure.
|
301
|
+
*/
|
302
|
+
setRemoveElements(cacheName: string, setName: string, elements: string[] | Uint8Array[]): Promise<CacheSetRemoveElements.Response>;
|
303
|
+
/**
|
304
|
+
* Associates the given key with the given value. If a value for the key is
|
305
|
+
* already present it is not replaced with the new value.
|
306
|
+
*
|
307
|
+
* @param {string} cacheName - The cache to store the value in.
|
308
|
+
* @param {string | Uint8Array} key - The key to set.
|
309
|
+
* @param {string | Uint8Array} field - The value to be stored.
|
310
|
+
* @param {SetIfNotExistsOptions} [options]
|
311
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
312
|
+
* Uses the client's default TTL if this is not supplied.
|
313
|
+
* @returns {Promise<CacheSetIfNotExists.Response>} -
|
314
|
+
* {@link CacheSetIfNotExists.Stored} on storing the new value.
|
315
|
+
* {@link CacheSetIfNotExists.NotStored} on not storing the new value.
|
316
|
+
* {@link CacheSetIfNotExists.Error} on failure.
|
317
|
+
*/
|
318
|
+
setIfNotExists(cacheName: string, key: string | Uint8Array, field: string | Uint8Array, options?: SetIfNotExistsOptions): Promise<CacheSetIfNotExists.Response>;
|
319
|
+
/**
|
320
|
+
* Flushes / clears all the items of the given cache
|
321
|
+
*
|
322
|
+
* @param {string} cacheName - The cache to be flushed.
|
323
|
+
* @returns {Promise<CacheFlush.Response>} -
|
324
|
+
* {@link CacheFlush.Success} on success.
|
325
|
+
* {@link CacheFlush.Error} on failure.
|
326
|
+
*/
|
327
|
+
flushCache(cacheName: string): Promise<CacheFlush.Response>;
|
328
|
+
/**
|
329
|
+
* Fetches all elements of the given dictionary.
|
330
|
+
*
|
331
|
+
* @param {string} cacheName - The cache to perform the lookup in.
|
332
|
+
* @param {string} dictionaryName - The dictionary to fetch.
|
333
|
+
* @returns {Promise<CacheDictionaryFetch.Response>} -
|
334
|
+
* {@link CacheDictionaryFetch.Hit} containing the dictionary elements if the
|
335
|
+
* dictionary exists.
|
336
|
+
* {@link CacheDictionaryFetch.Miss} if the dictionary does not exist.
|
337
|
+
* {@link CacheDictionaryFetch.Error} on failure.
|
338
|
+
*/
|
339
|
+
dictionaryFetch(cacheName: string, dictionaryName: string): Promise<CacheDictionaryFetch.Response>;
|
340
|
+
/**
|
341
|
+
* Adds an integer quantity to a field value.
|
342
|
+
*
|
343
|
+
* @remarks
|
344
|
+
* Incrementing the value of a missing field sets the value to amount.
|
345
|
+
*
|
346
|
+
* @param {string} cacheName - The cache containing the field.
|
347
|
+
* @param {string | Uint8Array} field - The field to increment.
|
348
|
+
* @param {number} amount - The quantity to add to the value. May be positive,
|
349
|
+
* negative, or zero. Defaults to 1.
|
350
|
+
* @param {IncrementOptions} options
|
351
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
352
|
+
* @returns {Promise<CacheIncrement>} -
|
353
|
+
* {@link CacheIncrement.Success} containing the incremented value
|
354
|
+
* on success.
|
355
|
+
* {@link CacheIncrement.Error} on failure. Incrementing a value
|
356
|
+
* that was not set using this method or is not the string representation of
|
357
|
+
* an integer results in a failure with a FailedPreconditionException error.
|
358
|
+
*/
|
359
|
+
increment(cacheName: string, field: string | Uint8Array, amount?: number, options?: IncrementOptions): Promise<CacheIncrement.Response>;
|
360
|
+
/**
|
361
|
+
* Adds an element to the given dictionary. Creates the dictionary if it does
|
362
|
+
* not already exist.
|
363
|
+
*
|
364
|
+
* @param {string} cacheName - The cache to store the dictionary in.
|
365
|
+
* @param {string} dictionaryName - The dictionary to add to.
|
366
|
+
* @param {string | Uint8Array} field - The field to set.
|
367
|
+
* @param {string | Uint8Array} value - The value to store.
|
368
|
+
* @param {DictionarySetFieldOptions} options
|
369
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
370
|
+
* Refreshes the dictionary's TTL using the client's default if this is not
|
371
|
+
* supplied.
|
372
|
+
* @returns {Promise<CacheDictionarySetField.Response>} -
|
373
|
+
* {@link CacheDictionarySetField.Success} on success.
|
374
|
+
* {@link CacheDictionarySetField.Error} on failure.
|
375
|
+
*/
|
376
|
+
dictionarySetField(cacheName: string, dictionaryName: string, field: string | Uint8Array, value: string | Uint8Array, options?: DictionarySetFieldOptions): Promise<CacheDictionarySetField.Response>;
|
377
|
+
/**
|
378
|
+
* Adds multiple elements to the given dictionary. Creates the dictionary if
|
379
|
+
* it does not already exist.
|
380
|
+
*
|
381
|
+
* @param {string} cacheName - The cache to store the dictionary in.
|
382
|
+
* @param {string} dictionaryName - The dictionary to add to.
|
383
|
+
* @param {Map<string | Uint8Array, string | Uint8Array>} elements - The
|
384
|
+
* elements to set.
|
385
|
+
* @param {DictionarySetFieldsOptions} options
|
386
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
387
|
+
* Refreshes the dictionary's TTL using the client's default if this is not
|
388
|
+
* supplied.
|
389
|
+
* @returns {Promise<CacheDictionarySetFields.Response>} -
|
390
|
+
* {@link CacheDictionarySetFields.Success} on success.
|
391
|
+
* {@link CacheDictionarySetFields.Error} on failure.
|
392
|
+
*/
|
393
|
+
dictionarySetFields(cacheName: string, dictionaryName: string, elements: Map<string | Uint8Array, string | Uint8Array> | Record<string, string | Uint8Array>, options?: DictionarySetFieldOptions): Promise<CacheDictionarySetFields.Response>;
|
394
|
+
/**
|
395
|
+
* Gets the value stored for the given dictionary and field.
|
396
|
+
*
|
397
|
+
* @param {string} cacheName - The cache containing the dictionary.
|
398
|
+
* @param {string} dictionaryName - The dictionary to look up.
|
399
|
+
* @param {string | Uint8Array} field - The field to look up.
|
400
|
+
* @returns {Promise<CacheDictionaryGetField.Response>} -
|
401
|
+
* {@link CacheDictionaryGetField.Hit} containing the dictionary element if
|
402
|
+
* one is found.
|
403
|
+
* {@link CacheDictionaryGetField.Miss} if the dictionary does not exist.
|
404
|
+
* {@link CacheDictionaryGetField.Error} on failure.
|
405
|
+
*/
|
406
|
+
dictionaryGetField(cacheName: string, dictionaryName: string, field: string | Uint8Array): Promise<CacheDictionaryGetField.Response>;
|
407
|
+
/**
|
408
|
+
* Gets multiple values from the given dictionary.
|
409
|
+
*
|
410
|
+
* @param {string} cacheName - The cache containing the dictionary.
|
411
|
+
* @param {string} dictionaryName - The dictionary to look up.
|
412
|
+
* @param {string[] | Uint8Array[]} fields - The fields to look up.
|
413
|
+
* @returns {Promise<CacheDictionaryGetFields.Response>} -
|
414
|
+
* {@link CacheDictionaryGetFields.Hit} containing the dictionary elements if
|
415
|
+
* the dictionary exists.
|
416
|
+
* {@link CacheDictionaryGetFields.Miss} if the dictionary does not exist.
|
417
|
+
* {@link CacheDictionaryGetFields.Error} on failure.
|
418
|
+
*/
|
419
|
+
dictionaryGetFields(cacheName: string, dictionaryName: string, fields: string[] | Uint8Array[]): Promise<CacheDictionaryGetFields.Response>;
|
420
|
+
/**
|
421
|
+
* Removes an element from the given dictionary.
|
422
|
+
*
|
423
|
+
* @remarks
|
424
|
+
* Performs a no-op if the dictionary or field does not exist.
|
425
|
+
*
|
426
|
+
* @param {string} cacheName - The cache containing the dictionary.
|
427
|
+
* @param {string} dictionaryName - The dictionary to remove from.
|
428
|
+
* @param {string | Uint8Array} field - The field to remove.
|
429
|
+
* @returns {Promise<CacheDictionaryRemoveField.Response>} -
|
430
|
+
* {@link CacheDictionaryRemoveField.Success} on success.
|
431
|
+
* {@link CacheDictionaryRemoveField.Error} on failure.
|
432
|
+
*/
|
433
|
+
dictionaryRemoveField(cacheName: string, dictionaryName: string, field: string | Uint8Array): Promise<CacheDictionaryRemoveField.Response>;
|
434
|
+
/**
|
435
|
+
* Removes multiple fields from the given dictionary.
|
436
|
+
*
|
437
|
+
* @remarks
|
438
|
+
* Performs a no-op if the dictionary or fields do not exist.
|
439
|
+
*
|
440
|
+
* @param {string} cacheName - The cache containing the dictionary.
|
441
|
+
* @param {string} dictionaryName - The dictionary to remove from.
|
442
|
+
* @param {string[] | Uint8Array[]} fields - The fields to remove.
|
443
|
+
* @returns {Promise<CacheDictionaryRemoveFields.Response>} -
|
444
|
+
* {@link CacheDictionaryRemoveFields.Success} on success.
|
445
|
+
* {@link CacheDictionaryRemoveFields.Error} on failure.
|
446
|
+
*/
|
447
|
+
dictionaryRemoveFields(cacheName: string, dictionaryName: string, fields: string[] | Uint8Array[]): Promise<CacheDictionaryRemoveFields.Response>;
|
448
|
+
/**
|
449
|
+
* Adds an integer quantity to a dictionary value.
|
450
|
+
*
|
451
|
+
* @remarks
|
452
|
+
* Incrementing the value of a missing field sets the value to amount.
|
453
|
+
*
|
454
|
+
* @param {string} cacheName - The cache containing the dictionary.
|
455
|
+
* @param {string} dictionaryName - The dictionary to set.
|
456
|
+
* @param {string | Uint8Array} field - The field to increment.
|
457
|
+
* @param {number} amount - The quantity to add to the value. May be positive,
|
458
|
+
* negative, or zero. Defaults to 1.
|
459
|
+
* @param {DictionaryIncrementOptions} options
|
460
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
461
|
+
* Refreshes the dictionary's TTL using the client's default if this is not
|
462
|
+
* supplied.
|
463
|
+
* @returns {Promise<CacheDictionaryIncrement.Response>} -
|
464
|
+
* {@link CacheDictionaryIncrement.Success} containing the incremented value
|
465
|
+
* on success.
|
466
|
+
* {@link CacheDictionaryIncrement.Error} on failure. Incrementing a value
|
467
|
+
* that was not set using this method or is not the string representation of
|
468
|
+
* an integer results in a failure with a FailedPreconditionException error.
|
469
|
+
*/
|
470
|
+
dictionaryIncrement(cacheName: string, dictionaryName: string, field: string | Uint8Array, amount?: number, options?: DictionaryIncrementOptions): Promise<CacheDictionaryIncrement.Response>;
|
471
|
+
/**
|
472
|
+
* Adds an element to the given sorted set. If the element already exists, its
|
473
|
+
* score is updated. Creates the sorted set if it does not exist.
|
474
|
+
*
|
475
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
476
|
+
* @param {string} sortedSetName - The sorted set to add to.
|
477
|
+
* @param {string | Uint8Array} value - The value to add.
|
478
|
+
* @param {number} score - The score to assign to the value.
|
479
|
+
* @param {SortedSetPutElementOptions} options
|
480
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
481
|
+
* Refreshes the sorted set's TTL using the client's default if this is not
|
482
|
+
* supplied.
|
483
|
+
* @returns {Promise<CacheSortedSetPutElement.Response>} -
|
484
|
+
* {@link CacheSortedSetPutElement.Success} on success.
|
485
|
+
* {@link CacheSortedSetPutElement.Error} on failure.
|
486
|
+
* @returns
|
487
|
+
*/
|
488
|
+
/**
|
489
|
+
* Adds elements to the given sorted set. For any values that already exist, it
|
490
|
+
* the score is updated. Creates the sorted set if it does not exist.
|
491
|
+
*
|
492
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
493
|
+
* @param {string} sortedSetName - The sorted set to add to.
|
494
|
+
* @param {Map<string | Uint8Array, number>| Record<string, number>} elements - The value->score pairs to add to the sorted set.
|
495
|
+
* @param {SortedSetPutElementOptions} options
|
496
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
497
|
+
* Refreshes the sorted set's TTL using the client's default if this is not
|
498
|
+
* supplied.
|
499
|
+
* @returns {Promise<CacheSortedSetPutElements.Response>} -
|
500
|
+
* {@link CacheSortedSetPutElements.Success} on success.
|
501
|
+
* {@link CacheSortedSetPutElements.Error} on failure.
|
502
|
+
* @returns
|
503
|
+
*/
|
504
|
+
/**
|
505
|
+
* Fetch the elements in the given sorted set by index (rank).
|
506
|
+
*
|
507
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
508
|
+
* @param {string} sortedSetName - The sorted set to fetch from.
|
509
|
+
* @param {SortedSetFetchByRankOptions} options
|
510
|
+
* @param {number} [options.startRank] - The rank of the first element to
|
511
|
+
* fetch. Defaults to 0. This rank is inclusive, ie the element at this rank
|
512
|
+
* will be fetched.
|
513
|
+
* @param {number} [options.endRank] - The rank of the last element to fetch.
|
514
|
+
* This rank is exclusive, ie the element at this rank will not be fetched.
|
515
|
+
* Defaults to null, which fetches up until and including the last element.
|
516
|
+
* @param {SortedSetOrder} [options.order] - The order to fetch the elements in.
|
517
|
+
* Defaults to ascending.
|
518
|
+
* @returns {Promise<CacheSortedSetFetch.Response>}
|
519
|
+
* {@link CacheSortedSetFetch.Hit} containing the requested elements when found.
|
520
|
+
* {@link CacheSortedSetFetch.Miss} when the sorted set does not exist.
|
521
|
+
* {@link CacheSortedSetFetch.Error} on failure.
|
522
|
+
*/
|
523
|
+
/**
|
524
|
+
* Fetch the elements in the given sorted set by score.
|
525
|
+
*
|
526
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
527
|
+
* @param {string} sortedSetName - The sorted set to fetch from.
|
528
|
+
* @param {SortedSetFetchByScoreOptions} options
|
529
|
+
* @param {number} [options.minScore] - The minimum score (inclusive) of the
|
530
|
+
* elements to fetch. Defaults to negative infinity.
|
531
|
+
* @param {number} [options.maxScore] - The maximum score (inclusive) of the
|
532
|
+
* elements to fetch. Defaults to positive infinity.
|
533
|
+
* @param {SortedSetOrder} [options.order] - The order to fetch the elements in.
|
534
|
+
* Defaults to ascending.
|
535
|
+
* @param {number} [options.offset] - The number of elements to skip before
|
536
|
+
* returning the first element. Defaults to 0. Note: this is not the rank of
|
537
|
+
* the first element to return, but the number of elements of the result set
|
538
|
+
* to skip before returning the first element.
|
539
|
+
* @param {number} [options.count] - The maximum number of elements to return.
|
540
|
+
* Defaults to undefined, which returns all elements.
|
541
|
+
* @returns {Promise<CacheSortedSetFetch.Response>} -
|
542
|
+
* {@link CacheSortedSetFetch.Hit} containing the requested elements when found.
|
543
|
+
* {@link CacheSortedSetFetch.Miss} when the sorted set does not exist.
|
544
|
+
* {@link CacheSortedSetFetch.Error} on failure.
|
545
|
+
*/
|
546
|
+
/**
|
547
|
+
* Look up the rank of an element in the sorted set, by the value of the element.
|
548
|
+
*
|
549
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
550
|
+
* @param {string} sortedSetName - The sorted set to fetch from.
|
551
|
+
* @param {string | Uint8Array} value - The value of the element whose rank we are retrieving.
|
552
|
+
* @returns {Promise<CacheSortedSetGetRank.Response>}
|
553
|
+
* {@link CacheSortedGetRank.Hit} containing the rank of the requested elements when found.
|
554
|
+
* {@link CacheSortedGetRank.Miss} when the element does not exist.
|
555
|
+
* {@link CacheSortedGetRank.Error} on failure.
|
556
|
+
*/
|
557
|
+
/**
|
558
|
+
* Look up the score of an element in the sorted set, by the value of the element.
|
559
|
+
*
|
560
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
561
|
+
* @param {string} sortedSetName - The sorted set to fetch from.
|
562
|
+
* @param {string | Uint8Array} value - The value of the element whose score we are retrieving.
|
563
|
+
* @returns {Promise<CacheSortedSetGetScore.Response>}
|
564
|
+
* {@link CacheSortedGetScore.Hit} containing the score of the requested element when found.
|
565
|
+
* {@link CacheSortedGetScore.Miss} when the element or collection does not exist.
|
566
|
+
* {@link CacheSortedGetScore.Error} on failure.
|
567
|
+
*/
|
568
|
+
/**
|
569
|
+
* Look up the scores of multiple elements in the sorted set, by the value of the elements.
|
570
|
+
*
|
571
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
572
|
+
* @param {string} sortedSetName - The sorted set to fetch from.
|
573
|
+
* @param {string[] | Uint8Array[]} values - The values of the elements whose scores we are retrieving.
|
574
|
+
* @returns {Promise<CacheSortedSetGetScores.Response>}
|
575
|
+
* {@link CacheSortedGetScores.Hit} containing the scores of the requested elements when found.
|
576
|
+
* {@link CacheSortedGetScores.Miss} when the element or collection does not exist.
|
577
|
+
* {@link CacheSortedGetScores.Error} on failure.
|
578
|
+
*/
|
579
|
+
/**
|
580
|
+
* Increment the score of an element in the sorted set.
|
581
|
+
*
|
582
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
583
|
+
* @param {string} sortedSetName - The sorted set to fetch from.
|
584
|
+
* @param {string | Uint8Array} value - The value of the element whose score we are incrementing.
|
585
|
+
* @param {number} amount - The quantity to add to the score. May be positive,
|
586
|
+
* negative, or zero. Defaults to 1.
|
587
|
+
* @param {SortedSetIncrementOptions} options
|
588
|
+
* @param {CollectionTtl} [options.ttl] - How the TTL should be managed.
|
589
|
+
* Refreshes the sorted set's TTL using the client's default if this is not
|
590
|
+
* supplied.
|
591
|
+
* @returns {Promise<CacheSortedSetIncrementScore.Response>} -
|
592
|
+
* {@link CacheSortedSetIncrementScore.Success} containing the incremented score
|
593
|
+
* on success.
|
594
|
+
* {@link CacheSortedSetIncrementScore.Error} on failure. Incrementing a score
|
595
|
+
* that was not set using this method or is not the string representation of
|
596
|
+
* an integer results in a failure with a FailedPreconditionException error.
|
597
|
+
*/
|
598
|
+
/**
|
599
|
+
* Remove an element from the sorted set
|
600
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
601
|
+
* @param {string} sortedSetName - The sorted set to remove from.
|
602
|
+
* @param {string | Uint8Array} value - The value of the element to remove from the set.
|
603
|
+
* @returns {Promise<CacheSortedSetRemoveElement.Response>}
|
604
|
+
* {@link CacheSortedSetRemoveElement.Success} if the element was successfully removed
|
605
|
+
* {@link CacheSortedSetIncrementScore.Error} on failure
|
606
|
+
*/
|
607
|
+
/**
|
608
|
+
* Remove multiple elements from the sorted set
|
609
|
+
* @param {string} cacheName - The cache containing the sorted set.
|
610
|
+
* @param {string} sortedSetName - The sorted set to remove from.
|
611
|
+
* @param {string | Uint8Array} values - The values of the elements to remove from the set.
|
612
|
+
* @returns {Promise<CacheSortedSetRemoveElement.Response>}
|
613
|
+
* {@link CacheSortedSetRemoveElement.Success} if the elements were successfully removed
|
614
|
+
* {@link CacheSortedSetIncrementScore.Error} on failure
|
615
|
+
*/
|
616
|
+
/**
|
617
|
+
* Creates a Momento signing key.
|
618
|
+
*
|
619
|
+
* @param {number} ttlMinutes - The time to live in minutes until the Momento
|
620
|
+
* signing key expires.
|
621
|
+
* @returns {Promise<CreateSigningKey.Response>} -
|
622
|
+
* {@link CreateSigningKey.Success} containing the key, key ID, endpoint, and
|
623
|
+
* expiration date on success.
|
624
|
+
* {@link CreateSigningKey.Error} on failure.
|
625
|
+
*/
|
626
|
+
/**
|
627
|
+
* Revokes a Momento signing key.
|
628
|
+
*
|
629
|
+
* @remarks
|
630
|
+
* All tokens signed by this key will be invalid.
|
631
|
+
*
|
632
|
+
* @param {string} keyId - The ID of the key to revoke.
|
633
|
+
* @returns {Promise<RevokeSigningKey.Response>} -
|
634
|
+
* {@link RevokeSigningKey.Success} on success.
|
635
|
+
* {@link RevokeSigningKey.Error} on failure.
|
636
|
+
*/
|
637
|
+
protected getNextDataClient(): IDataClient;
|
638
|
+
}
|