@gomomento/sdk-core 1.28.0 → 1.30.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.
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUta2V5LWV4aXN0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUta2V5LWV4aXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBNkU7QUFFN0U7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtCRztBQUNILE1BQXNCLFFBQVMsU0FBUSw0QkFBWTtDQUFHO0FBQXRELDRCQUFzRDtBQUV0RCxNQUFNLFFBQVMsU0FBUSxRQUFRO0lBRzdCLFlBQVksTUFBaUI7UUFDM0IsS0FBSyxFQUFFLENBQUM7UUFDUixJQUFJLENBQUMsT0FBTyxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUMzQixDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksTUFBTTtRQUNYLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN0QixDQUFDO0lBRWUsUUFBUTtRQUN0QixPQUFPLEdBQUcsS0FBSyxDQUFDLFFBQVEsRUFBRSxhQUFhLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxDQUFDO0lBQ2pFLENBQUM7Q0FDRjtBQUVEOztHQUVHO0FBQ0gsTUFBYSxPQUFRLFNBQVEsSUFBQSwrQkFBZSxFQUFDLFFBQVEsQ0FBQztDQUFHO0FBQXpELDBCQUF5RDtBQUV6RCxNQUFNLE1BQU8sU0FBUSxRQUFRO0lBQzNCLFlBQXNCLGVBQXlCO1FBQzdDLEtBQUssRUFBRSxDQUFDO1FBRFksb0JBQWUsR0FBZixlQUFlLENBQVU7SUFFL0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VxuXG4vKipcbiAqIEluZGljYXRlcyB0aGF0IGFuIGVycm9yIG9jY3VycmVkIGR1cmluZyB0aGUgY2FjaGUga2V5IGV4aXN0cyByZXF1ZXN0LlxuICpcbiAqIFRoaXMgcmVzcG9uc2Ugb2JqZWN0IGluY2x1ZGVzIHRoZSBmb2xsb3dpbmcgZmllbGRzIHRoYXQgeW91IGNhbiB1c2UgdG8gZGV0ZXJtaW5lXG4gKiBob3cgeW91IHdvdWxkIGxpa2UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUta2V5cy1leGlzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUta2V5cy1leGlzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBNkU7QUFFN0U7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtCRztBQUNILE1BQXNCLFFBQVMsU0FBUSw0QkFBWTtDQUFHO0FBQXRELDRCQUFzRDtBQ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UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
@@ -0,0 +1,74 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for an decrease TTL request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Set}
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 CacheDecreaseTtl.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheDecreaseTtl.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 _Set extends Response {
26
+ }
27
+ declare const Set_base: {
28
+ new (...args: any[]): {
29
+ readonly is_success: boolean;
30
+ };
31
+ } & typeof _Set;
32
+ /**
33
+ * Indicates a successful decrease TTL request.
34
+ */
35
+ export declare class Set extends Set_base {
36
+ }
37
+ declare class _Miss extends Response {
38
+ }
39
+ declare const Miss_base: {
40
+ new (...args: any[]): {
41
+ readonly is_miss: boolean;
42
+ };
43
+ } & typeof _Miss;
44
+ /**
45
+ * Indicates a successful decrease TTL request.
46
+ */
47
+ export declare class Miss extends Miss_base {
48
+ }
49
+ declare class _Error extends Response {
50
+ protected _innerException: SdkError;
51
+ constructor(_innerException: SdkError);
52
+ }
53
+ declare const Error_base: {
54
+ new (...args: any[]): {
55
+ _innerException: SdkError;
56
+ message(): string;
57
+ innerException(): SdkError;
58
+ errorCode(): import("../../errors").MomentoErrorCode;
59
+ toString(): string;
60
+ };
61
+ } & typeof _Error;
62
+ /**
63
+ * Indicates that an error occurred during the decrease TTL request.
64
+ *
65
+ * This response object includes the following fields that you can use to determine
66
+ * how you would like to handle the error:
67
+ *
68
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
69
+ * - `message()` - a human-readable description of the error
70
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
71
+ */
72
+ export declare class Error extends Error_base {
73
+ }
74
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Set = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for an decrease TTL request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Set}
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 CacheDecreaseTtl.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheDecreaseTtl.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 _Set extends Response {
29
+ }
30
+ /**
31
+ * Indicates a successful decrease TTL request.
32
+ */
33
+ class Set extends (0, response_base_1.ResponseSuccess)(_Set) {
34
+ }
35
+ exports.Set = Set;
36
+ class _Miss extends Response {
37
+ }
38
+ /**
39
+ * Indicates a successful decrease TTL request.
40
+ */
41
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
42
+ }
43
+ exports.Miss = Miss;
44
+ class _Error extends Response {
45
+ constructor(_innerException) {
46
+ super();
47
+ this._innerException = _innerException;
48
+ }
49
+ }
50
+ /**
51
+ * Indicates that an error occurred during the decrease TTL request.
52
+ *
53
+ * This response object includes the following fields that you can use to determine
54
+ * how you would like to handle the error:
55
+ *
56
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
57
+ * - `message()` - a human-readable description of the error
58
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
59
+ */
60
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
61
+ }
62
+ exports.Error = Error;
63
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtdHRsLWRlY3JlYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS10dGwtZGVjcmVhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBS3lCO0FBRXpCOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsTUFBc0IsUUFBUyxTQUFRLDRCQUFZO0NBQUc7QUFBdEQsNEJBQXNEO0FBRXRELE1BQU0sSUFBSyxTQUFRLFFBQVE7Q0FBRztBQUU5Qjs7R0FFRztBQUNILE1BQWEsR0FBSSxTQUFRLElBQUEsK0JBQWUsRUFBQyxJQUFJLENBQUM7Q0FBRztBQUFqRCxrQkFBaUQ7QUFFakQsTUFBTSxLQUFNLFNBQVEsUUFBUTtDQUFHO0FBRS9COztHQUVHO0FBQ0gsTUFBYSxJQUFLLFNBQVEsSUFBQSw0Q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CBpbmNsdWRlcyB0aGUgZm9sbG93aW5nIGZpZWxkcyB0aGF0IHlvdSBjYW4gdXNlIHRvIGRldGVybWluZVxuICogaG93IHlvdSB3b3VsZCBsaWtlIHRvIGhhbmRsZSB0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIFJlc3BvbnNlRXJyb3IoX0Vycm9yKSB7fVxuIl19
@@ -0,0 +1,74 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for an increase TTL request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Set}
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 CacheIncreaseTtl.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheIncreaseTtl.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 _Set extends Response {
26
+ }
27
+ declare const Set_base: {
28
+ new (...args: any[]): {
29
+ readonly is_success: boolean;
30
+ };
31
+ } & typeof _Set;
32
+ /**
33
+ * Indicates a successful increase TTL request.
34
+ */
35
+ export declare class Set extends Set_base {
36
+ }
37
+ declare class _Miss extends Response {
38
+ }
39
+ declare const Miss_base: {
40
+ new (...args: any[]): {
41
+ readonly is_miss: boolean;
42
+ };
43
+ } & typeof _Miss;
44
+ /**
45
+ * Indicates a successful increase TTL request.
46
+ */
47
+ export declare class Miss extends Miss_base {
48
+ }
49
+ declare class _Error extends Response {
50
+ protected _innerException: SdkError;
51
+ constructor(_innerException: SdkError);
52
+ }
53
+ declare const Error_base: {
54
+ new (...args: any[]): {
55
+ _innerException: SdkError;
56
+ message(): string;
57
+ innerException(): SdkError;
58
+ errorCode(): import("../../errors").MomentoErrorCode;
59
+ toString(): string;
60
+ };
61
+ } & typeof _Error;
62
+ /**
63
+ * Indicates that an error occurred during the increase TTL request.
64
+ *
65
+ * This response object includes the following fields that you can use to determine
66
+ * how you would like to handle the error:
67
+ *
68
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
69
+ * - `message()` - a human-readable description of the error
70
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
71
+ */
72
+ export declare class Error extends Error_base {
73
+ }
74
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Set = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for an increase TTL request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Set}
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 CacheIncreaseTtl.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheIncreaseTtl.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 _Set extends Response {
29
+ }
30
+ /**
31
+ * Indicates a successful increase TTL request.
32
+ */
33
+ class Set extends (0, response_base_1.ResponseSuccess)(_Set) {
34
+ }
35
+ exports.Set = Set;
36
+ class _Miss extends Response {
37
+ }
38
+ /**
39
+ * Indicates a successful increase TTL request.
40
+ */
41
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
42
+ }
43
+ exports.Miss = Miss;
44
+ class _Error extends Response {
45
+ constructor(_innerException) {
46
+ super();
47
+ this._innerException = _innerException;
48
+ }
49
+ }
50
+ /**
51
+ * Indicates that an error occurred during the increase TTL request.
52
+ *
53
+ * This response object includes the following fields that you can use to determine
54
+ * how you would like to handle the error:
55
+ *
56
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
57
+ * - `message()` - a human-readable description of the error
58
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
59
+ */
60
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
61
+ }
62
+ exports.Error = Error;
63
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtdHRsLWluY3JlYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS10dGwtaW5jcmVhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBS3lCO0FBRXpCOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsTUFBc0IsUUFBUyxTQUFRLDRCQUFZO0NBQUc7QUFBdEQsNEJBQXNEO0FBRXRELE1BQU0sSUFBSyxTQUFRLFFBQVE7Q0FBRztBQUU5Qjs7R0FFRztBQUNILE1BQWEsR0FBSSxTQUFRLElBQUEsK0JBQWUsRUFBQyxJQUFJLENBQUM7Q0FBRztBQUFqRCxrQkFBaUQ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b2NjdXJyZWQgZHVyaW5nIHRoZSBpbmNyZWFzZSBUVEwgcmVxdWVzdC5cbiAqXG4gKiBUaGlzIHJlc3BvbnNlIG9iamVjdCBpbmNsdWRlcyB0aGUgZm9sbG93aW5nIGZpZWxkcyB0aGF0IHlvdSBjYW4gdXNlIHRvIGRldGVybWluZVxuICogaG93IHlvdSB3b3VsZCBsaWtlIHRvIGhhbmRsZSB0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIFJlc3BvbnNlRXJyb3IoX0Vycm9yKSB7fVxuIl19
@@ -0,0 +1,74 @@
1
+ import { SdkError } from '../../errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for an update TTL request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Set}
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 CacheUpdateTtl.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheUpdateTtl.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 _Set extends Response {
26
+ }
27
+ declare const Set_base: {
28
+ new (...args: any[]): {
29
+ readonly is_success: boolean;
30
+ };
31
+ } & typeof _Set;
32
+ /**
33
+ * Indicates a successful update TTL request.
34
+ */
35
+ export declare class Set extends Set_base {
36
+ }
37
+ declare class _Miss extends Response {
38
+ }
39
+ declare const Miss_base: {
40
+ new (...args: any[]): {
41
+ readonly is_miss: boolean;
42
+ };
43
+ } & typeof _Miss;
44
+ /**
45
+ * Indicates a successful update TTL request.
46
+ */
47
+ export declare class Miss extends Miss_base {
48
+ }
49
+ declare class _Error extends Response {
50
+ protected _innerException: SdkError;
51
+ constructor(_innerException: SdkError);
52
+ }
53
+ declare const Error_base: {
54
+ new (...args: any[]): {
55
+ _innerException: SdkError;
56
+ message(): string;
57
+ innerException(): SdkError;
58
+ errorCode(): import("../../errors").MomentoErrorCode;
59
+ toString(): string;
60
+ };
61
+ } & typeof _Error;
62
+ /**
63
+ * Indicates that an error occurred during the update TTL request.
64
+ *
65
+ * This response object includes the following fields that you can use to determine
66
+ * how you would like to handle the error:
67
+ *
68
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
69
+ * - `message()` - a human-readable description of the error
70
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
71
+ */
72
+ export declare class Error extends Error_base {
73
+ }
74
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Set = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for an update TTL request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Set}
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 CacheUpdateTtl.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheUpdateTtl.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 _Set extends Response {
29
+ }
30
+ /**
31
+ * Indicates a successful update TTL request.
32
+ */
33
+ class Set extends (0, response_base_1.ResponseSuccess)(_Set) {
34
+ }
35
+ exports.Set = Set;
36
+ class _Miss extends Response {
37
+ }
38
+ /**
39
+ * Indicates a successful update TTL request.
40
+ */
41
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
42
+ }
43
+ exports.Miss = Miss;
44
+ class _Error extends Response {
45
+ constructor(_innerException) {
46
+ super();
47
+ this._innerException = _innerException;
48
+ }
49
+ }
50
+ /**
51
+ * Indicates that an error occurred during the update TTL request.
52
+ *
53
+ * This response object includes the following fields that you can use to determine
54
+ * how you would like to handle the error:
55
+ *
56
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
57
+ * - `message()` - a human-readable description of the error
58
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
59
+ */
60
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
61
+ }
62
+ exports.Error = Error;
63
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtdHRsLXVwZGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtdHRsLXVwZGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFLeUI7QUFFekI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FtQkc7QUFDSCxNQUFzQixRQUFTLFNBQVEsNEJBQVk7Q0FBRztBQUF0RCw0QkFBc0Q7QUFFdEQsTUFBTSxJQUFLLFNBQVEsUUFBUTtDQUFHO0FBRTlCOztHQUVHO0FBQ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ycm9yKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxufVxuXG4vKipcbiAqIEluZGljYXRlcyB0aGF0IGFuIGVycm9yIG9jY3VycmVkIGR1cmluZyB0aGUgdXBkYXRlIFRUTCByZXF1ZXN0LlxuICpcbiAqIFRoaXMgcmVzcG9uc2Ugb2JqZWN0IGluY2x1ZGVzIHRoZSBmb2xsb3dpbmcgZmllbGRzIHRoYXQgeW91IGNhbiB1c2UgdG8gZGV0ZXJtaW5lXG4gKiBob3cgeW91IHdvdWxkIGxpa2UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gomomento/sdk-core",
3
- "version": "1.28.0",
3
+ "version": "1.30.0",
4
4
  "description": "Common code for Momento JS SDKs",
5
5
  "main": "dist/src/index.js",
6
6
  "files": [
@@ -25,7 +25,6 @@
25
25
  "author": "",
26
26
  "license": "Apache-2.0",
27
27
  "devDependencies": {
28
- "@types/google-protobuf": "^3.15.5",
29
28
  "@types/jest": "^27.0.2",
30
29
  "@types/node": "14.18.3",
31
30
  "@typescript-eslint/eslint-plugin": "^5.0.0",