@gomomento/sdk-core 1.113.0 → 1.115.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.
- package/dist/src/clients/ICacheClient.d.ts +14 -2
- package/dist/src/clients/ICacheClient.js +1 -1
- package/dist/src/clients/IMomentoCache.d.ts +12 -1
- package/dist/src/clients/IMomentoCache.js +1 -1
- package/dist/src/index.d.ts +8 -2
- package/dist/src/index.js +16 -4
- package/dist/src/internal/clients/cache/AbstractCacheClient.d.ts +101 -2
- package/dist/src/internal/clients/cache/AbstractCacheClient.js +117 -1
- package/dist/src/internal/clients/cache/IDataClient.d.ts +7 -1
- package/dist/src/internal/clients/cache/IDataClient.js +1 -1
- package/dist/src/internal/clients/cache/momento-cache.d.ts +12 -1
- package/dist/src/internal/clients/cache/momento-cache.js +19 -1
- package/dist/src/messages/responses/cache-get-with-hash.d.ts +76 -0
- package/dist/src/messages/responses/cache-get-with-hash.js +107 -0
- package/dist/src/messages/responses/cache-set-if-absent-or-hash-equal.d.ts +47 -0
- package/dist/src/messages/responses/cache-set-if-absent-or-hash-equal.js +60 -0
- package/dist/src/messages/responses/cache-set-if-absent-or-hash-not-equal.d.ts +47 -0
- package/dist/src/messages/responses/cache-set-if-absent-or-hash-not-equal.js +60 -0
- package/dist/src/messages/responses/cache-set-if-present-and-hash-equal.d.ts +47 -0
- package/dist/src/messages/responses/cache-set-if-present-and-hash-equal.js +60 -0
- package/dist/src/messages/responses/cache-set-if-present-and-hash-not-equal.d.ts +47 -0
- package/dist/src/messages/responses/cache-set-if-present-and-hash-not-equal.js +60 -0
- package/dist/src/messages/responses/cache-set-with-hash.d.ts +46 -0
- package/dist/src/messages/responses/cache-set-with-hash.js +59 -0
- package/dist/src/messages/responses/enums/cache/scalar/index.d.ts +30 -0
- package/dist/src/messages/responses/enums/cache/scalar/index.js +38 -2
- package/dist/src/utils/cache-call-options.d.ts +2 -0
- package/dist/src/utils/cache-call-options.js +1 -1
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CreateCache, DeleteCache, ListCaches, CacheFlush, CacheGet, CacheSet, CacheDelete, CacheIncrement, IncrementOptions, CacheSetIfNotExists, SetIfNotExistsOptions, SetIfAbsentOptions, SetIfPresentOptions, SetIfEqualOptions, SetIfNotEqualOptions, SetIfPresentAndNotEqualOptions, SetIfAbsentOrEqualOptions, CacheSetFetch, CacheSetAddElement, CacheSetAddElements, CacheSetContainsElement, CacheSetContainsElements, CacheSetRemoveElement, CacheSetRemoveElements, CacheListFetch, CacheListLength, CacheListPushFront, CacheListPushBack, CacheListConcatenateBack, CacheListConcatenateFront, CacheListPopBack, CacheListPopFront, CacheListRemoveValue, CacheListRetain, CacheDictionarySetField, CacheDictionarySetFields, CacheDictionaryGetField, CacheDictionaryGetFields, CacheDictionaryIncrement, CacheDictionaryFetch, CacheDictionaryRemoveField, CacheDictionaryRemoveFields, CacheDictionaryLength, CacheSortedSetFetch, CacheSortedSetPutElement, CacheSortedSetPutElements, CacheSortedSetGetRank, CacheSortedSetGetScore, CacheSortedSetGetScores, CacheSortedSetIncrementScore, CacheSortedSetRemoveElement, CacheSortedSetRemoveElements, CacheSortedSetLength, CacheSortedSetLengthByScore, CacheSortedSetUnionStore, CacheItemGetTtl, CacheItemGetType, CacheKeyExists, CacheKeysExist, CacheUpdateTtl, CacheIncreaseTtl, CacheDecreaseTtl, CacheGetBatch, CacheSetBatch, CacheSetIfAbsent, CacheSetIfPresent, CacheSetIfEqual, CacheSetIfNotEqual, CacheSetIfPresentAndNotEqual, CacheSetIfAbsentOrEqual, CacheSetSample, CacheSetPop, CacheSetLength } from '../../../index';
|
1
|
+
import { CreateCache, DeleteCache, ListCaches, CacheFlush, CacheGet, CacheSet, CacheDelete, CacheIncrement, IncrementOptions, CacheSetIfNotExists, SetIfNotExistsOptions, SetIfAbsentOptions, SetIfPresentOptions, SetIfEqualOptions, SetIfNotEqualOptions, SetIfPresentAndNotEqualOptions, SetIfAbsentOrEqualOptions, SetIfPresentAndHashEqualOptions, SetIfPresentAndHashNotEqualOptions, SetIfAbsentOrHashEqualOptions, SetIfAbsentOrHashNotEqualOptions, CacheSetFetch, CacheSetAddElement, CacheSetAddElements, CacheSetContainsElement, CacheSetContainsElements, CacheSetRemoveElement, CacheSetRemoveElements, CacheListFetch, CacheListLength, CacheListPushFront, CacheListPushBack, CacheListConcatenateBack, CacheListConcatenateFront, CacheListPopBack, CacheListPopFront, CacheListRemoveValue, CacheListRetain, CacheDictionarySetField, CacheDictionarySetFields, CacheDictionaryGetField, CacheDictionaryGetFields, CacheDictionaryIncrement, CacheDictionaryFetch, CacheDictionaryRemoveField, CacheDictionaryRemoveFields, CacheDictionaryLength, CacheSortedSetFetch, CacheSortedSetPutElement, CacheSortedSetPutElements, CacheSortedSetGetRank, CacheSortedSetGetScore, CacheSortedSetGetScores, CacheSortedSetIncrementScore, CacheSortedSetRemoveElement, CacheSortedSetRemoveElements, CacheSortedSetLength, CacheSortedSetLengthByScore, CacheSortedSetUnionStore, CacheItemGetTtl, CacheItemGetType, CacheKeyExists, CacheKeysExist, CacheUpdateTtl, CacheIncreaseTtl, CacheDecreaseTtl, CacheGetBatch, CacheSetBatch, CacheSetIfAbsent, CacheSetIfPresent, CacheSetIfEqual, CacheSetIfNotEqual, CacheSetIfPresentAndNotEqual, CacheSetIfAbsentOrEqual, CacheSetSample, CacheSetPop, CacheSetLength, CacheGetWithHash, CacheSetWithHash, CacheSetIfPresentAndHashEqual, CacheSetIfPresentAndHashNotEqual, CacheSetIfAbsentOrHashEqual, CacheSetIfAbsentOrHashNotEqual } from '../../../index';
|
2
2
|
import { ListFetchCallOptions, ListRetainCallOptions, SetBatchItem, SortedSetSource } from '../../../utils';
|
3
|
-
import { ICacheClient, SetOptions, SetAddElementOptions, SetAddElementsOptions, ListPushFrontOptions, ListPushBackOptions, ListConcatenateBackOptions, ListConcatenateFrontOptions, DictionarySetFieldOptions, DictionarySetFieldsOptions, DictionaryIncrementOptions, SortedSetFetchByRankOptions, SortedSetPutElementOptions, SortedSetPutElementsOptions, SortedSetFetchByScoreOptions, SortedSetGetRankOptions, SortedSetIncrementOptions, SortedSetLengthByScoreOptions, SortedSetUnionStoreOptions, SetBatchOptions, GetOptions, GetBatchOptions } from '../../../clients/ICacheClient';
|
3
|
+
import { ICacheClient, SetOptions, SetAddElementOptions, SetAddElementsOptions, ListPushFrontOptions, ListPushBackOptions, ListConcatenateBackOptions, ListConcatenateFrontOptions, DictionarySetFieldOptions, DictionarySetFieldsOptions, DictionaryIncrementOptions, SortedSetFetchByRankOptions, SortedSetPutElementOptions, SortedSetPutElementsOptions, SortedSetFetchByScoreOptions, SortedSetGetRankOptions, SortedSetIncrementOptions, SortedSetLengthByScoreOptions, SortedSetUnionStoreOptions, SetBatchOptions, GetOptions, GetBatchOptions, GetWithHashOptions, SetWithHashOptions } from '../../../clients/ICacheClient';
|
4
4
|
import { IControlClient } from './IControlClient';
|
5
5
|
import { IDataClient } from './IDataClient';
|
6
6
|
import { IPingClient } from './IPingClient';
|
@@ -57,6 +57,20 @@ export declare abstract class AbstractCacheClient implements ICacheClient {
|
|
57
57
|
* {@link CacheGet.Error} on failure.
|
58
58
|
*/
|
59
59
|
get(cacheName: string, key: string | Uint8Array, options?: GetOptions): Promise<CacheGet.Response>;
|
60
|
+
/**
|
61
|
+
* Gets the value stored for the given key and its hash.
|
62
|
+
*
|
63
|
+
* @param {string} cacheName - The cache to perform the lookup in.
|
64
|
+
* @param {string | Uint8Array} key - The key to look up.
|
65
|
+
* @param {GetOptions} [options]
|
66
|
+
* @param {decompress} [options.decompress=false] - Whether to decompress the value. Overrides the client-wide
|
67
|
+
* automatic decompression setting.
|
68
|
+
* @returns {Promise<CacheGet.Response>} -
|
69
|
+
* {@link CacheGetWithHash.Hit} containing the value and hash if one is found.
|
70
|
+
* {@link CacheGetWithHash.Miss} if the key does not exist.
|
71
|
+
* {@link CacheGetWithHash.Error} on failure.
|
72
|
+
*/
|
73
|
+
getWithHash(cacheName: string, key: string | Uint8Array, options?: GetWithHashOptions): Promise<CacheGetWithHash.Response>;
|
60
74
|
/**
|
61
75
|
* Associates the given key with the given value. If a value for the key is
|
62
76
|
* already present it is replaced with the new value.
|
@@ -73,6 +87,23 @@ export declare abstract class AbstractCacheClient implements ICacheClient {
|
|
73
87
|
* {@link CacheSet.Error} on failure.
|
74
88
|
*/
|
75
89
|
set(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, options?: SetOptions): Promise<CacheSet.Response>;
|
90
|
+
/**
|
91
|
+
* Associates the given key with the given value. If a value for the key is
|
92
|
+
* already present it is replaced with the new value. Returns the hash of the value.
|
93
|
+
*
|
94
|
+
* @param {string} cacheName - The cache to store the value in.
|
95
|
+
* @param {string | Uint8Array} key - The key to set.
|
96
|
+
* @param {string | Uint8Array} value - The value to be stored.
|
97
|
+
* @param {SetOptions} [options]
|
98
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
99
|
+
* Uses the client's default TTL if this is not supplied.
|
100
|
+
* @param {boolean} [options.compress=false] - Whether to compress the value. Defaults to false.
|
101
|
+
* @returns {Promise<CacheSet.Response>} -
|
102
|
+
* {@link CacheSetWithHash.Stored} on success containing the hash of the value stored.
|
103
|
+
* {@link CacheSetWithHash.NotStored} on not storing the new value.
|
104
|
+
* {@link CacheSetWithHash.Error} on failure.
|
105
|
+
*/
|
106
|
+
setWithHash(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, options?: SetWithHashOptions): Promise<CacheSetWithHash.Response>;
|
76
107
|
/**
|
77
108
|
* Removes the given key from the cache. The key can represent a single value
|
78
109
|
* or a collection.
|
@@ -515,6 +546,74 @@ export declare abstract class AbstractCacheClient implements ICacheClient {
|
|
515
546
|
* {@link CacheSetIfAbsentOrEqual.Error} on failure.
|
516
547
|
*/
|
517
548
|
setIfAbsentOrEqual(cacheName: string, key: string | Uint8Array, field: string | Uint8Array, equal: string | Uint8Array, options?: SetIfAbsentOrEqualOptions): Promise<CacheSetIfAbsentOrEqual.Response>;
|
549
|
+
/**
|
550
|
+
* Associates the given key with the given value if key is present in the cache
|
551
|
+
* and its hash is equal to the supplied 'hashEqual' hash.
|
552
|
+
*
|
553
|
+
* @param {string} cacheName - The cache to store the value in.
|
554
|
+
* @param {string | Uint8Array} key - The key to set.
|
555
|
+
* @param {string | Uint8Array} value - The value to be stored.
|
556
|
+
* @param {Uint8Array} hashEqual - The hash to compare to the cached hash.
|
557
|
+
* @param {SetIfPresentAndHashEqualOptions} [options]
|
558
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
559
|
+
* Uses the client's default TTL if this is not supplied.
|
560
|
+
* @returns {Promise<CacheSetIfPresentAndHashEqual.Response>} -
|
561
|
+
* {@link CacheSetIfPresentAndHashEqual.Stored} on storing the new value.
|
562
|
+
* {@link CacheSetIfPresentAndHashEqual.NotStored} on not storing the new value.
|
563
|
+
* {@link CacheSetIfPresentAndHashEqual.Error} on failure.
|
564
|
+
*/
|
565
|
+
setIfPresentAndHashEqual(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, hashEqual: Uint8Array, options?: SetIfPresentAndHashEqualOptions): Promise<CacheSetIfPresentAndHashEqual.Response>;
|
566
|
+
/**
|
567
|
+
* Associates the given key with the given value if key is present in the cache
|
568
|
+
* and its hash is not equal to the supplied 'hashNotEqual' hash.
|
569
|
+
*
|
570
|
+
* @param {string} cacheName - The cache to store the value in.
|
571
|
+
* @param {string | Uint8Array} key - The key to set.
|
572
|
+
* @param {string | Uint8Array} value - The value to be stored.
|
573
|
+
* @param {Uint8Array} hashNotEqual - The hash to compare to the cached hash.
|
574
|
+
* @param {SetIfPresentAndHashNotEqualOptions} [options]
|
575
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
576
|
+
* Uses the client's default TTL if this is not supplied.
|
577
|
+
* @returns {Promise<CacheSetIfPresentAndHashNotEqual.Response>} -
|
578
|
+
* {@link CacheSetIfPresentAndHashNotEqual.Stored} on storing the new value.
|
579
|
+
* {@link CacheSetIfPresentAndHashNotEqual.NotStored} on not storing the new value.
|
580
|
+
* {@link CacheSetIfPresentAndHashNotEqual.Error} on failure.
|
581
|
+
*/
|
582
|
+
setIfPresentAndHashNotEqual(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, hashNotEqual: Uint8Array, options?: SetIfPresentAndHashNotEqualOptions): Promise<CacheSetIfPresentAndHashNotEqual.Response>;
|
583
|
+
/**
|
584
|
+
* Associates the given key with the given value if key is absent or if the key is
|
585
|
+
* present and its value's hash is equal to the given 'hashEqual' hash.
|
586
|
+
*
|
587
|
+
* @param {string} cacheName - The cache to store the value in.
|
588
|
+
* @param {string | Uint8Array} key - The key to set.
|
589
|
+
* @param {string | Uint8Array} value - The value to be stored.
|
590
|
+
* @param {string | Uint8Array} hashEqual - The value to compare to the cached value.
|
591
|
+
* @param {setIfAbsentOrHashEqualOptions} [options]
|
592
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
593
|
+
* Uses the client's default TTL if this is not supplied.
|
594
|
+
* @returns {Promise<CacheSetIfAbsentOrHashEqual.Response>} -
|
595
|
+
* {@link CacheSetIfAbsentOrHashEqual.Stored} on storing the new value.
|
596
|
+
* {@link CacheSetIfAbsentOrHashEqual.NotStored} on not storing the new value.
|
597
|
+
* {@link CacheSetIfAbsentOrHashEqual.Error} on failure.
|
598
|
+
*/
|
599
|
+
setIfAbsentOrHashEqual(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, hashEqual: Uint8Array, options?: SetIfAbsentOrHashEqualOptions): Promise<CacheSetIfAbsentOrHashEqual.Response>;
|
600
|
+
/**
|
601
|
+
* Associates the given key with the given value if key is absent or if the key is
|
602
|
+
* present and its value's hash is not equal to the given 'hashNotEqual' hash.
|
603
|
+
*
|
604
|
+
* @param {string} cacheName - The cache to store the value in.
|
605
|
+
* @param {string | Uint8Array} key - The key to set.
|
606
|
+
* @param {string | Uint8Array} value - The value to be stored.
|
607
|
+
* @param {string | Uint8Array} hashNotEqual - The value to compare to the cached value.
|
608
|
+
* @param {SetIfAbsentOrHashNotEqualOptions} [options]
|
609
|
+
* @param {number} [options.ttl] - The time to live for the item in the cache.
|
610
|
+
* Uses the client's default TTL if this is not supplied.
|
611
|
+
* @returns {Promise<CacheSetIfAbsentOrHashNotEqual.Response>} -
|
612
|
+
* {@link CacheSetIfAbsentOrHashNotEqual.Stored} on storing the new value.
|
613
|
+
* {@link CacheSetIfAbsentOrHashNotEqual.NotStored} on not storing the new value.
|
614
|
+
* {@link CacheSetIfAbsentOrHashNotEqual.Error} on failure.
|
615
|
+
*/
|
616
|
+
setIfAbsentOrHashNotEqual(cacheName: string, key: string | Uint8Array, value: string | Uint8Array, hashNotEqual: Uint8Array, options?: SetIfAbsentOrHashNotEqualOptions): Promise<CacheSetIfAbsentOrHashNotEqual.Response>;
|
518
617
|
/**
|
519
618
|
* Flushes / clears all the items of the given cache
|
520
619
|
*
|