@gomomento/sdk-core 1.27.2 → 1.29.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 (25) hide show
  1. package/dist/src/clients/ICacheClient.d.ts +10 -2
  2. package/dist/src/clients/ICacheClient.js +1 -1
  3. package/dist/src/index.d.ts +8 -1
  4. package/dist/src/index.js +16 -2
  5. package/dist/src/internal/clients/cache/AbstractCacheClient.d.ts +78 -2
  6. package/dist/src/internal/clients/cache/AbstractCacheClient.js +98 -1
  7. package/dist/src/internal/clients/cache/IDataClient.d.ts +8 -1
  8. package/dist/src/internal/clients/cache/IDataClient.js +1 -1
  9. package/dist/src/messages/responses/cache-key-exists.d.ts +69 -0
  10. package/dist/src/messages/responses/cache-key-exists.js +68 -0
  11. package/dist/src/messages/responses/cache-keys-exist.d.ts +69 -0
  12. package/dist/src/messages/responses/cache-keys-exist.js +69 -0
  13. package/dist/src/messages/responses/cache-sorted-set-length-by-score.d.ts +81 -0
  14. package/dist/src/messages/responses/cache-sorted-set-length-by-score.js +78 -0
  15. package/dist/src/messages/responses/cache-sorted-set-length.d.ts +81 -0
  16. package/dist/src/messages/responses/cache-sorted-set-length.js +78 -0
  17. package/dist/src/messages/responses/cache-ttl-decrease.d.ts +74 -0
  18. package/dist/src/messages/responses/cache-ttl-decrease.js +63 -0
  19. package/dist/src/messages/responses/cache-ttl-increase.d.ts +74 -0
  20. package/dist/src/messages/responses/cache-ttl-increase.js +63 -0
  21. package/dist/src/messages/responses/cache-ttl-update.d.ts +74 -0
  22. package/dist/src/messages/responses/cache-ttl-update.js +63 -0
  23. package/dist/src/utils/cache-call-options.d.ts +12 -0
  24. package/dist/src/utils/cache-call-options.js +1 -1
  25. package/package.json +1 -1
@@ -0,0 +1,69 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for a cache key exists request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Success}
9
+ * - {Error}
10
+ *
11
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
12
+ * @example
13
+ * For example:
14
+ * ```
15
+ * if (response instanceof CacheKeyExists.Error) {
16
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
17
+ * // `CacheKeyExists.Error` in this block, so you will have access to the properties
18
+ * // of the Error class; e.g. `response.errorCode()`.
19
+ * }
20
+ * ```
21
+ */
22
+ export declare abstract class Response extends ResponseBase {
23
+ }
24
+ declare class _Success extends Response {
25
+ private readonly _exists;
26
+ constructor(exists: boolean[]);
27
+ /**
28
+ * The boolean indicating whether the given key was found in the cache.
29
+ * @returns {boolean}
30
+ */
31
+ exists(): boolean;
32
+ toString(): string;
33
+ }
34
+ declare const Success_base: {
35
+ new (...args: any[]): {
36
+ readonly is_success: boolean;
37
+ };
38
+ } & typeof _Success;
39
+ /**
40
+ * Indicates a Successful cache key exists request.
41
+ */
42
+ export declare class Success extends Success_base {
43
+ }
44
+ declare class _Error extends Response {
45
+ protected _innerException: SdkError;
46
+ constructor(_innerException: SdkError);
47
+ }
48
+ declare const Error_base: {
49
+ new (...args: any[]): {
50
+ _innerException: SdkError;
51
+ message(): string;
52
+ innerException(): SdkError;
53
+ errorCode(): import("../../errors").MomentoErrorCode;
54
+ toString(): string;
55
+ };
56
+ } & typeof _Error;
57
+ /**
58
+ * Indicates that an error occurred during the cache key exists request.
59
+ *
60
+ * This response object includes the following fields that you can use to determine
61
+ * how you would like to handle the error:
62
+ *
63
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
64
+ * - `message()` - a human-readable description of the error
65
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
66
+ */
67
+ export declare class Error extends Error_base {
68
+ }
69
+ export {};
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Success = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a cache key exists request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Success}
11
+ * - {Error}
12
+ *
13
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
14
+ * @example
15
+ * For example:
16
+ * ```
17
+ * if (response instanceof CacheKeyExists.Error) {
18
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
19
+ * // `CacheKeyExists.Error` in this block, so you will have access to the properties
20
+ * // of the Error class; e.g. `response.errorCode()`.
21
+ * }
22
+ * ```
23
+ */
24
+ class Response extends response_base_1.ResponseBase {
25
+ }
26
+ exports.Response = Response;
27
+ class _Success extends Response {
28
+ constructor(exists) {
29
+ super();
30
+ this._exists = exists[0];
31
+ }
32
+ /**
33
+ * The boolean indicating whether the given key was found in the cache.
34
+ * @returns {boolean}
35
+ */
36
+ exists() {
37
+ return this._exists;
38
+ }
39
+ toString() {
40
+ return `${super.toString()}: exists: ${String(this.exists())}`;
41
+ }
42
+ }
43
+ /**
44
+ * Indicates a Successful cache key exists request.
45
+ */
46
+ class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
47
+ }
48
+ exports.Success = Success;
49
+ class _Error extends Response {
50
+ constructor(_innerException) {
51
+ super();
52
+ this._innerException = _innerException;
53
+ }
54
+ }
55
+ /**
56
+ * Indicates that an error occurred during the cache key exists request.
57
+ *
58
+ * This response object includes the following fields that you can use to determine
59
+ * how you would like to handle the error:
60
+ *
61
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
62
+ * - `message()` - a human-readable description of the error
63
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
64
+ */
65
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
66
+ }
67
+ exports.Error = Error;
68
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUta2V5LWV4aXN0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYW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aW5lXG4gKiBob3cgeW91IHdvdWxkIGxpa2UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
@@ -0,0 +1,69 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for a cache keys exist request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Success}
9
+ * - {Error}
10
+ *
11
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
12
+ * @example
13
+ * For example:
14
+ * ```
15
+ * if (response instanceof CacheKeysExist.Error) {
16
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
17
+ * // `CacheKeysExist.Error` in this block, so you will have access to the properties
18
+ * // of the Error class; e.g. `response.errorCode()`.
19
+ * }
20
+ * ```
21
+ */
22
+ export declare abstract class Response extends ResponseBase {
23
+ }
24
+ declare class _Success extends Response {
25
+ private readonly _exists;
26
+ constructor(exists: boolean[]);
27
+ /**
28
+ * A list of booleans indicating whether each given key was found in the cache.
29
+ * @returns {boolean[]}
30
+ */
31
+ exists(): boolean[];
32
+ toString(): string;
33
+ }
34
+ declare const Success_base: {
35
+ new (...args: any[]): {
36
+ readonly is_success: boolean;
37
+ };
38
+ } & typeof _Success;
39
+ /**
40
+ * Indicates a Successful cache keys exist request.
41
+ */
42
+ export declare class Success extends Success_base {
43
+ }
44
+ declare class _Error extends Response {
45
+ protected _innerException: SdkError;
46
+ constructor(_innerException: SdkError);
47
+ }
48
+ declare const Error_base: {
49
+ new (...args: any[]): {
50
+ _innerException: SdkError;
51
+ message(): string;
52
+ innerException(): SdkError;
53
+ errorCode(): import("../../errors").MomentoErrorCode;
54
+ toString(): string;
55
+ };
56
+ } & typeof _Error;
57
+ /**
58
+ * Indicates that an error occurred during the cache keys exist request.
59
+ *
60
+ * This response object includes the following fields that you can use to determine
61
+ * how you would like to handle the error:
62
+ *
63
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
64
+ * - `message()` - a human-readable description of the error
65
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
66
+ */
67
+ export declare class Error extends Error_base {
68
+ }
69
+ export {};
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Success = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a cache keys exist request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Success}
11
+ * - {Error}
12
+ *
13
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
14
+ * @example
15
+ * For example:
16
+ * ```
17
+ * if (response instanceof CacheKeysExist.Error) {
18
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
19
+ * // `CacheKeysExist.Error` in this block, so you will have access to the properties
20
+ * // of the Error class; e.g. `response.errorCode()`.
21
+ * }
22
+ * ```
23
+ */
24
+ class Response extends response_base_1.ResponseBase {
25
+ }
26
+ exports.Response = Response;
27
+ class _Success extends Response {
28
+ constructor(exists) {
29
+ super();
30
+ this._exists = exists;
31
+ }
32
+ /**
33
+ * A list of booleans indicating whether each given key was found in the cache.
34
+ * @returns {boolean[]}
35
+ */
36
+ exists() {
37
+ return this._exists;
38
+ }
39
+ toString() {
40
+ const booleans = this._exists.map(bool => bool);
41
+ return super.toString() + ': exists: ' + booleans.join(', ');
42
+ }
43
+ }
44
+ /**
45
+ * Indicates a Successful cache keys exist request.
46
+ */
47
+ class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
48
+ }
49
+ exports.Success = Success;
50
+ class _Error extends Response {
51
+ constructor(_innerException) {
52
+ super();
53
+ this._innerException = _innerException;
54
+ }
55
+ }
56
+ /**
57
+ * Indicates that an error occurred during the cache keys exist request.
58
+ *
59
+ * This response object includes the following fields that you can use to determine
60
+ * how you would like to handle the error:
61
+ *
62
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
63
+ * - `message()` - a human-readable description of the error
64
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
65
+ */
66
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
67
+ }
68
+ exports.Error = Error;
69
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUta2V5cy1leGlzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUta2V5cy1leGlzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBNkU7QUFFN0U7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtCRztBQUNILE1BQXNCLFFBQVMsU0FBUSw0QkFBWTtDQUFHO0FBQXRELDRCQUFzRDtBQUV0RCxNQUFNLFFBQVMsU0FBUSxRQUFRO0lBRzdCLFlBQVksTUFBaUI7UUFDM0IsS0FBSyxFQUFFLENBQUM7UUFDUixJQUFJLENBQUMsT0FBTyxHQUFHLE1BQU0sQ0FBQztJQUN4QixDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksTUFBTTtRQUNYLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN0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24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
@@ -0,0 +1,81 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for a sorted set length request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Hit}
9
+ * - {Miss}
10
+ * - {Error}
11
+ *
12
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
13
+ * @example
14
+ * For example:
15
+ * ```
16
+ * if (response instanceof CacheSortedSetLengthByScore.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheSortedSetLengthByScore.Error` in this block, so you will have access to the properties
19
+ * // of the Error class; e.g. `response.errorCode()`.
20
+ * }
21
+ * ```
22
+ */
23
+ export declare abstract class Response extends ResponseBase {
24
+ }
25
+ declare class _Hit extends Response {
26
+ private readonly _length;
27
+ constructor(length: number);
28
+ /**
29
+ * Returns the length of the sorted set
30
+ * @returns {number}
31
+ */
32
+ length(): number;
33
+ toString(): string;
34
+ }
35
+ declare const Hit_base: {
36
+ new (...args: any[]): {};
37
+ } & typeof _Hit;
38
+ /**
39
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
40
+ * `value*` accessors to retrieve the data in the appropriate format.
41
+ */
42
+ export declare class Hit extends Hit_base {
43
+ }
44
+ declare class _Miss extends Response {
45
+ }
46
+ declare const Miss_base: {
47
+ new (...args: any[]): {
48
+ readonly is_miss: boolean;
49
+ };
50
+ } & typeof _Miss;
51
+ /**
52
+ * Indicates that the requested data was not available in the cache.
53
+ */
54
+ export declare class Miss extends Miss_base {
55
+ }
56
+ declare class _Error extends Response {
57
+ protected _innerException: SdkError;
58
+ constructor(_innerException: SdkError);
59
+ }
60
+ declare const Error_base: {
61
+ new (...args: any[]): {
62
+ _innerException: SdkError;
63
+ message(): string;
64
+ innerException(): SdkError;
65
+ errorCode(): import("../../errors").MomentoErrorCode;
66
+ toString(): string;
67
+ };
68
+ } & typeof _Error;
69
+ /**
70
+ * Indicates that an error occurred during the sorted set length request.
71
+ *
72
+ * This response object includes the following fields that you can use to determine
73
+ * how you would like to handle the error:
74
+ *
75
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
76
+ * - `message()` - a human-readable description of the error
77
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
78
+ */
79
+ export declare class Error extends Error_base {
80
+ }
81
+ export {};
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Hit = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a sorted set length request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Hit}
11
+ * - {Miss}
12
+ * - {Error}
13
+ *
14
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
15
+ * @example
16
+ * For example:
17
+ * ```
18
+ * if (response instanceof CacheSortedSetLengthByScore.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheSortedSetLengthByScore.Error` in this block, so you will have access to the properties
21
+ * // of the Error class; e.g. `response.errorCode()`.
22
+ * }
23
+ * ```
24
+ */
25
+ class Response extends response_base_1.ResponseBase {
26
+ }
27
+ exports.Response = Response;
28
+ class _Hit extends Response {
29
+ constructor(length) {
30
+ super();
31
+ this._length = length;
32
+ }
33
+ /**
34
+ * Returns the length of the sorted set
35
+ * @returns {number}
36
+ */
37
+ length() {
38
+ return this._length;
39
+ }
40
+ toString() {
41
+ return `${super.toString()}: length ${this._length}`;
42
+ }
43
+ }
44
+ /**
45
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
46
+ * `value*` accessors to retrieve the data in the appropriate format.
47
+ */
48
+ class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
49
+ }
50
+ exports.Hit = Hit;
51
+ class _Miss extends Response {
52
+ }
53
+ /**
54
+ * Indicates that the requested data was not available in the cache.
55
+ */
56
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
57
+ }
58
+ exports.Miss = Miss;
59
+ class _Error extends Response {
60
+ constructor(_innerException) {
61
+ super();
62
+ this._innerException = _innerException;
63
+ }
64
+ }
65
+ /**
66
+ * Indicates that an error occurred during the sorted set length request.
67
+ *
68
+ * This response object includes the following fields that you can use to determine
69
+ * how you would like to handle the error:
70
+ *
71
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
72
+ * - `message()` - a human-readable description of the error
73
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
74
+ */
75
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
76
+ }
77
+ exports.Error = Error;
78
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc29ydGVkLXNldC1sZW5ndGgtYnktc2NvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcmVzcG9uc2VzL2NhY2hlLXNvcnRlZC1zZXQtbGVuZ3RoLWJ5LXNjb3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLG1EQUt5QjtBQUV6Qjs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW1CRztBQUNILE1BQXNCLFFBQVMsU0FBUSw0QkFBWTtDQUFHO0FBQXRELDRCQUFzRDtBQUV0RCxNQUFNLElBQUssU0FBUSxRQUFRO0lBRXpCLFlBQVksTUFBYztRQUN4QixLQUFLLEVBQUUsQ0FBQztRQUNSLElBQUksQ0FBQyxPQUFPLEdBQ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BsZW5ndGggcmVxdWVzdC5cbiAqXG4gKiBUaGlzIHJlc3BvbnNlIG9iamVjdCBpbmNsdWRlcyB0aGUgZm9sbG93aW5nIGZpZWxkcyB0aGF0IHlvdSBjYW4gdXNlIHRvIGRldGVybWluZVxuICogaG93IHlvdSB3b3VsZCBsaWtlIHRvIGhhbmRsZSB0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIFJlc3BvbnNlRXJyb3IoX0Vycm9yKSB7fVxuIl19
@@ -0,0 +1,81 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for a sorted set length request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Hit}
9
+ * - {Miss}
10
+ * - {Error}
11
+ *
12
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
13
+ * @example
14
+ * For example:
15
+ * ```
16
+ * if (response instanceof CacheSortedSetLength.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheSortedSetLength.Error` in this block, so you will have access to the properties
19
+ * // of the Error class; e.g. `response.errorCode()`.
20
+ * }
21
+ * ```
22
+ */
23
+ export declare abstract class Response extends ResponseBase {
24
+ }
25
+ declare class _Hit extends Response {
26
+ private readonly _length;
27
+ constructor(length: number);
28
+ /**
29
+ * Returns the length of the sorted set
30
+ * @returns {number}
31
+ */
32
+ length(): number;
33
+ toString(): string;
34
+ }
35
+ declare const Hit_base: {
36
+ new (...args: any[]): {};
37
+ } & typeof _Hit;
38
+ /**
39
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
40
+ * `value*` accessors to retrieve the data in the appropriate format.
41
+ */
42
+ export declare class Hit extends Hit_base {
43
+ }
44
+ declare class _Miss extends Response {
45
+ }
46
+ declare const Miss_base: {
47
+ new (...args: any[]): {
48
+ readonly is_miss: boolean;
49
+ };
50
+ } & typeof _Miss;
51
+ /**
52
+ * Indicates that the requested data was not available in the cache.
53
+ */
54
+ export declare class Miss extends Miss_base {
55
+ }
56
+ declare class _Error extends Response {
57
+ protected _innerException: SdkError;
58
+ constructor(_innerException: SdkError);
59
+ }
60
+ declare const Error_base: {
61
+ new (...args: any[]): {
62
+ _innerException: SdkError;
63
+ message(): string;
64
+ innerException(): SdkError;
65
+ errorCode(): import("../../errors").MomentoErrorCode;
66
+ toString(): string;
67
+ };
68
+ } & typeof _Error;
69
+ /**
70
+ * Indicates that an error occurred during the sorted set length request.
71
+ *
72
+ * This response object includes the following fields that you can use to determine
73
+ * how you would like to handle the error:
74
+ *
75
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
76
+ * - `message()` - a human-readable description of the error
77
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
78
+ */
79
+ export declare class Error extends Error_base {
80
+ }
81
+ export {};
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Hit = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a sorted set length request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Hit}
11
+ * - {Miss}
12
+ * - {Error}
13
+ *
14
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
15
+ * @example
16
+ * For example:
17
+ * ```
18
+ * if (response instanceof CacheSortedSetLength.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheSortedSetLength.Error` in this block, so you will have access to the properties
21
+ * // of the Error class; e.g. `response.errorCode()`.
22
+ * }
23
+ * ```
24
+ */
25
+ class Response extends response_base_1.ResponseBase {
26
+ }
27
+ exports.Response = Response;
28
+ class _Hit extends Response {
29
+ constructor(length) {
30
+ super();
31
+ this._length = length;
32
+ }
33
+ /**
34
+ * Returns the length of the sorted set
35
+ * @returns {number}
36
+ */
37
+ length() {
38
+ return this._length;
39
+ }
40
+ toString() {
41
+ return `${super.toString()}: length ${this._length}`;
42
+ }
43
+ }
44
+ /**
45
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
46
+ * `value*` accessors to retrieve the data in the appropriate format.
47
+ */
48
+ class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
49
+ }
50
+ exports.Hit = Hit;
51
+ class _Miss extends Response {
52
+ }
53
+ /**
54
+ * Indicates that the requested data was not available in the cache.
55
+ */
56
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
57
+ }
58
+ exports.Miss = Miss;
59
+ class _Error extends Response {
60
+ constructor(_innerException) {
61
+ super();
62
+ this._innerException = _innerException;
63
+ }
64
+ }
65
+ /**
66
+ * Indicates that an error occurred during the sorted set length request.
67
+ *
68
+ * This response object includes the following fields that you can use to determine
69
+ * how you would like to handle the error:
70
+ *
71
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
72
+ * - `message()` - a human-readable description of the error
73
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
74
+ */
75
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
76
+ }
77
+ exports.Error = Error;
78
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc29ydGVkLXNldC1sZW5ndGguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8u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