@gomomento/sdk-core 1.86.0 → 1.88.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/auth/credential-provider.d.ts +26 -0
- package/dist/src/auth/credential-provider.js +45 -7
- package/dist/src/errors/errors.js +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -1
- package/dist/src/internal/utils/auth.d.ts +7 -3
- package/dist/src/internal/utils/auth.js +19 -7
- package/dist/src/messages/responses/cache-batch-get.d.ts +18 -51
- package/dist/src/messages/responses/cache-batch-get.js +23 -56
- package/dist/src/messages/responses/cache-batch-set.d.ts +14 -51
- package/dist/src/messages/responses/cache-batch-set.js +12 -42
- package/dist/src/messages/responses/cache-delete.d.ts +11 -44
- package/dist/src/messages/responses/cache-delete.js +14 -35
- package/dist/src/messages/responses/cache-dictionary-fetch.d.ts +18 -54
- package/dist/src/messages/responses/cache-dictionary-fetch.js +23 -46
- package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +19 -58
- package/dist/src/messages/responses/cache-dictionary-get-field.js +19 -52
- package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +19 -56
- package/dist/src/messages/responses/cache-dictionary-get-fields.js +27 -50
- package/dist/src/messages/responses/cache-dictionary-increment.d.ts +14 -46
- package/dist/src/messages/responses/cache-dictionary-increment.js +14 -41
- package/dist/src/messages/responses/cache-dictionary-length.d.ts +19 -53
- package/dist/src/messages/responses/cache-dictionary-length.js +26 -40
- package/dist/src/messages/responses/cache-dictionary-remove-field.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-remove-field.js +13 -34
- package/dist/src/messages/responses/cache-dictionary-remove-fields.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-remove-fields.js +13 -34
- package/dist/src/messages/responses/cache-dictionary-set-field.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-set-field.js +13 -34
- package/dist/src/messages/responses/cache-dictionary-set-fields.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-set-fields.js +13 -34
- package/dist/src/messages/responses/cache-flush.d.ts +12 -45
- package/dist/src/messages/responses/cache-flush.js +15 -36
- package/dist/src/messages/responses/cache-get.d.ts +19 -54
- package/dist/src/messages/responses/cache-get.js +22 -45
- package/dist/src/messages/responses/cache-increment.d.ts +24 -51
- package/dist/src/messages/responses/cache-increment.js +27 -49
- package/dist/src/messages/responses/cache-item-get-ttl.d.ts +22 -55
- package/dist/src/messages/responses/cache-item-get-ttl.js +27 -41
- package/dist/src/messages/responses/cache-item-get-type.d.ts +22 -55
- package/dist/src/messages/responses/cache-item-get-type.js +27 -41
- package/dist/src/messages/responses/cache-key-exists.d.ts +16 -47
- package/dist/src/messages/responses/cache-key-exists.js +17 -38
- package/dist/src/messages/responses/cache-keys-exist.d.ts +16 -47
- package/dist/src/messages/responses/cache-keys-exist.js +16 -37
- package/dist/src/messages/responses/cache-list-concatenate-back.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-concatenate-back.js +13 -37
- package/dist/src/messages/responses/cache-list-concatenate-front.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-concatenate-front.js +13 -37
- package/dist/src/messages/responses/cache-list-fetch.d.ts +23 -58
- package/dist/src/messages/responses/cache-list-fetch.js +26 -49
- package/dist/src/messages/responses/cache-list-length.d.ts +27 -59
- package/dist/src/messages/responses/cache-list-length.js +32 -42
- package/dist/src/messages/responses/cache-list-pop-back.d.ts +22 -57
- package/dist/src/messages/responses/cache-list-pop-back.js +25 -48
- package/dist/src/messages/responses/cache-list-pop-front.d.ts +22 -57
- package/dist/src/messages/responses/cache-list-pop-front.js +25 -48
- package/dist/src/messages/responses/cache-list-push-back.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-push-back.js +13 -37
- package/dist/src/messages/responses/cache-list-push-front.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-push-front.js +13 -37
- package/dist/src/messages/responses/cache-list-remove-value.d.ts +11 -44
- package/dist/src/messages/responses/cache-list-remove-value.js +14 -35
- package/dist/src/messages/responses/cache-list-retain.d.ts +11 -44
- package/dist/src/messages/responses/cache-list-retain.js +14 -35
- package/dist/src/messages/responses/cache-set-add-element.d.ts +10 -53
- package/dist/src/messages/responses/cache-set-add-element.js +13 -34
- package/dist/src/messages/responses/cache-set-add-elements.d.ts +12 -45
- package/dist/src/messages/responses/cache-set-add-elements.js +17 -38
- package/dist/src/messages/responses/cache-set-fetch.d.ts +18 -54
- package/dist/src/messages/responses/cache-set-fetch.js +23 -46
- package/dist/src/messages/responses/cache-set-if-absent-or-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-absent-or-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-absent.d.ts +14 -63
- package/dist/src/messages/responses/cache-set-if-absent.js +20 -40
- package/dist/src/messages/responses/cache-set-if-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-not-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-not-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-not-exists.d.ts +14 -54
- package/dist/src/messages/responses/cache-set-if-not-exists.js +20 -40
- package/dist/src/messages/responses/cache-set-if-present-and-not-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-present-and-not-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-present.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-present.js +21 -41
- package/dist/src/messages/responses/cache-set-remove-element.d.ts +10 -43
- package/dist/src/messages/responses/cache-set-remove-element.js +13 -34
- package/dist/src/messages/responses/cache-set-remove-elements.d.ts +13 -46
- package/dist/src/messages/responses/cache-set-remove-elements.js +13 -34
- package/dist/src/messages/responses/cache-set-sample.d.ts +18 -54
- package/dist/src/messages/responses/cache-set-sample.js +23 -46
- package/dist/src/messages/responses/cache-set.d.ts +10 -43
- package/dist/src/messages/responses/cache-set.js +13 -34
- package/dist/src/messages/responses/cache-sorted-set-fetch.js +1 -1
- package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +6 -1
- package/dist/src/messages/responses/cache-sorted-set-get-score.js +1 -1
- package/dist/src/messages/responses/cache-sorted-set-get-scores.js +1 -1
- package/dist/src/messages/responses/cache-sorted-set-increment-score.js +1 -1
- package/dist/src/messages/responses/cache-ttl-decrease.d.ts +19 -53
- package/dist/src/messages/responses/cache-ttl-decrease.js +29 -39
- package/dist/src/messages/responses/cache-ttl-increase.d.ts +19 -53
- package/dist/src/messages/responses/cache-ttl-increase.js +29 -39
- package/dist/src/messages/responses/cache-ttl-update.d.ts +15 -55
- package/dist/src/messages/responses/cache-ttl-update.js +21 -41
- package/dist/src/messages/responses/create-cache.d.ts +15 -58
- package/dist/src/messages/responses/create-cache.js +21 -39
- package/dist/src/messages/responses/delete-cache.d.ts +11 -44
- package/dist/src/messages/responses/delete-cache.js +14 -35
- package/dist/src/messages/responses/enums/auth/generate-api-key.d.ts +4 -0
- package/dist/src/messages/responses/enums/auth/generate-api-key.js +9 -0
- package/dist/src/messages/responses/enums/auth/generate-disposable-token.d.ts +4 -0
- package/dist/src/messages/responses/enums/auth/generate-disposable-token.js +9 -0
- package/dist/src/messages/responses/enums/auth/index.d.ts +3 -0
- package/dist/src/messages/responses/enums/auth/index.js +10 -0
- package/dist/src/messages/responses/enums/auth/refresh-api-key.d.ts +4 -0
- package/dist/src/messages/responses/enums/auth/refresh-api-key.js +9 -0
- package/dist/src/messages/responses/enums/cache/control/index.d.ts +17 -0
- package/dist/src/messages/responses/enums/cache/control/index.js +25 -0
- package/dist/src/messages/responses/enums/cache/dictionary/index.d.ts +40 -0
- package/dist/src/messages/responses/enums/cache/dictionary/index.js +53 -0
- package/dist/src/messages/responses/enums/cache/index.d.ts +5 -0
- package/dist/src/messages/responses/enums/cache/index.js +22 -0
- package/dist/src/messages/responses/enums/cache/list/index.d.ts +44 -0
- package/dist/src/messages/responses/enums/cache/list/index.js +58 -0
- package/dist/src/messages/responses/enums/cache/scalar/index.d.ts +95 -0
- package/dist/src/messages/responses/enums/cache/scalar/index.js +122 -0
- package/dist/src/messages/responses/enums/cache/set/index.d.ts +26 -0
- package/dist/src/messages/responses/enums/cache/set/index.js +36 -0
- package/dist/src/messages/responses/enums/index.d.ts +4 -0
- package/dist/src/messages/responses/enums/index.js +21 -0
- package/dist/src/messages/responses/enums/leaderboard/index.d.ts +20 -0
- package/dist/src/messages/responses/enums/leaderboard/index.js +29 -0
- package/dist/src/messages/responses/enums/topics/index.d.ts +8 -0
- package/dist/src/messages/responses/enums/topics/index.js +14 -0
- package/dist/src/messages/responses/generate-api-key.d.ts +10 -27
- package/dist/src/messages/responses/generate-api-key.js +10 -18
- package/dist/src/messages/responses/generate-disposable-token.d.ts +10 -27
- package/dist/src/messages/responses/generate-disposable-token.js +10 -18
- package/dist/src/messages/responses/leaderboard/leaderboard-delete.d.ts +10 -43
- package/dist/src/messages/responses/leaderboard/leaderboard-delete.js +13 -34
- package/dist/src/messages/responses/leaderboard/leaderboard-fetch.d.ts +12 -45
- package/dist/src/messages/responses/leaderboard/leaderboard-fetch.js +11 -35
- package/dist/src/messages/responses/leaderboard/leaderboard-length.d.ts +12 -45
- package/dist/src/messages/responses/leaderboard/leaderboard-length.js +11 -35
- package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.d.ts +10 -43
- package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.js +13 -34
- package/dist/src/messages/responses/leaderboard/leaderboard-upsert.d.ts +11 -44
- package/dist/src/messages/responses/leaderboard/leaderboard-upsert.js +14 -35
- package/dist/src/messages/responses/list-caches.d.ts +13 -46
- package/dist/src/messages/responses/list-caches.js +11 -35
- package/dist/src/messages/responses/refresh-api-key.d.ts +10 -27
- package/dist/src/messages/responses/refresh-api-key.js +10 -18
- package/dist/src/messages/responses/response-base.d.ts +20 -0
- package/dist/src/messages/responses/response-base.js +42 -2
- package/dist/src/messages/responses/topic-publish.d.ts +10 -43
- package/dist/src/messages/responses/topic-publish.js +13 -34
- package/dist/src/messages/responses/topic-subscribe.d.ts +10 -37
- package/dist/src/messages/responses/topic-subscribe.js +10 -33
- package/dist/src/messages/responses/webhook/put-webhook.d.ts +1 -10
- package/package.json +1 -1
@@ -1,54 +1,40 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Miss = exports.
|
3
|
+
exports.Error = exports.Miss = exports.NotSet = exports.Set = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
|
+
const enums_1 = require("./enums");
|
5
6
|
/**
|
6
|
-
*
|
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
|
-
* ```
|
7
|
+
* Indicates the ttl was successfully decreased.
|
24
8
|
*/
|
25
|
-
class
|
26
|
-
|
27
|
-
|
28
|
-
|
9
|
+
class Set extends response_base_1.ResponseBase {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.type = enums_1.CacheDecreaseTtlResponse.Set;
|
13
|
+
}
|
29
14
|
}
|
15
|
+
exports.Set = Set;
|
30
16
|
/**
|
31
|
-
* Indicates
|
17
|
+
* Indicates the ttl was not updated due to a failed condition.
|
32
18
|
*/
|
33
|
-
class
|
34
|
-
|
35
|
-
|
36
|
-
|
19
|
+
class NotSet extends response_base_1.ResponseBase {
|
20
|
+
constructor() {
|
21
|
+
super(...arguments);
|
22
|
+
this.type = enums_1.CacheDecreaseTtlResponse.NotSet;
|
23
|
+
}
|
37
24
|
}
|
25
|
+
exports.NotSet = NotSet;
|
38
26
|
/**
|
39
|
-
* Indicates
|
27
|
+
* Indicates the requested item was not found in the cache.
|
40
28
|
*/
|
41
|
-
class Miss extends
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
constructor(_innerException) {
|
46
|
-
super();
|
47
|
-
this._innerException = _innerException;
|
29
|
+
class Miss extends response_base_1.BaseResponseMiss {
|
30
|
+
constructor() {
|
31
|
+
super(...arguments);
|
32
|
+
this.type = enums_1.CacheDecreaseTtlResponse.Miss;
|
48
33
|
}
|
49
34
|
}
|
35
|
+
exports.Miss = Miss;
|
50
36
|
/**
|
51
|
-
* Indicates that an error occurred during the decrease
|
37
|
+
* Indicates that an error occurred during the decrease ttl request.
|
52
38
|
*
|
53
39
|
* This response object includes the following fields that you can use to determine
|
54
40
|
* how you would like to handle the error:
|
@@ -57,7 +43,11 @@ class _Error extends Response {
|
|
57
43
|
* - `message()` - a human-readable description of the error
|
58
44
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
59
45
|
*/
|
60
|
-
class Error extends
|
46
|
+
class Error extends response_base_1.BaseResponseError {
|
47
|
+
constructor(_innerException) {
|
48
|
+
super(_innerException);
|
49
|
+
this.type = enums_1.CacheDecreaseTtlResponse.Error;
|
50
|
+
}
|
61
51
|
}
|
62
52
|
exports.Error = Error;
|
63
|
-
//# sourceMappingURL=data:application/json;base64,
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtdHRsLWRlY3JlYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS10dGwtZGVjcmVhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBSXlCO0FBQ3pCLG1DQUFpRDtBQ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W4gdXNlIHRvIGRldGVybWluZVxuICogaG93IHlvdSB3b3VsZCBsaWtlIHRvIGhhbmRsZSB0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIEJhc2VSZXNwb25zZUVycm9yIGltcGxlbWVudHMgSVJlc3BvbnNlIHtcbiAgY29uc3RydWN0b3IoX2lubmVyRXhjZXB0aW9uOiBTZGtFcnJvcikge1xuICAgIHN1cGVyKF9pbm5lckV4Y2VwdGlvbik7XG4gIH1cblxuICByZWFkb25seSB0eXBlOiBDYWNoZURlY3JlYXNlVHRsUmVzcG9uc2UuRXJyb3IgPVxuICAgIENhY2hlRGVjcmVhc2VUdGxSZXNwb25zZS5FcnJvcjtcbn1cblxuZXhwb3J0IHR5cGUgUmVzcG9uc2UgPSBTZXQgfCBOb3RTZXQgfCBNaXNzIHwgRXJyb3I7XG4iXX0=
|
@@ -1,66 +1,29 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import { ResponseBase } from './response-base';
|
2
|
+
import { BaseResponseError, BaseResponseMiss, ResponseBase } from './response-base';
|
3
|
+
import { CacheIncreaseTtlResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: CacheIncreaseTtlResponse;
|
6
|
+
}
|
3
7
|
/**
|
4
|
-
*
|
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
|
-
* ```
|
8
|
+
* Indicates the ttl was successfully increased.
|
22
9
|
*/
|
23
|
-
export declare
|
24
|
-
|
25
|
-
declare class _Set extends Response {
|
10
|
+
export declare class Set extends ResponseBase implements IResponse {
|
11
|
+
readonly type: CacheIncreaseTtlResponse.Set;
|
26
12
|
}
|
27
|
-
declare const Set_base: {
|
28
|
-
new (...args: any[]): {
|
29
|
-
readonly is_success: boolean;
|
30
|
-
};
|
31
|
-
} & typeof _Set;
|
32
13
|
/**
|
33
|
-
* Indicates
|
14
|
+
* Indicates the ttl was not updated due to a failed condition.
|
34
15
|
*/
|
35
|
-
export declare class
|
16
|
+
export declare class NotSet extends ResponseBase implements IResponse {
|
17
|
+
readonly type: CacheIncreaseTtlResponse.NotSet;
|
36
18
|
}
|
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
19
|
/**
|
45
|
-
* Indicates
|
20
|
+
* Indicates the requested item was not found in the cache.
|
46
21
|
*/
|
47
|
-
export declare class Miss extends
|
48
|
-
|
49
|
-
declare class _Error extends Response {
|
50
|
-
protected _innerException: SdkError;
|
51
|
-
constructor(_innerException: SdkError);
|
22
|
+
export declare class Miss extends BaseResponseMiss implements IResponse {
|
23
|
+
readonly type: CacheIncreaseTtlResponse.Miss;
|
52
24
|
}
|
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
25
|
/**
|
63
|
-
* Indicates that an error occurred during the increase
|
26
|
+
* Indicates that an error occurred during the increase ttl request.
|
64
27
|
*
|
65
28
|
* This response object includes the following fields that you can use to determine
|
66
29
|
* how you would like to handle the error:
|
@@ -69,6 +32,9 @@ declare const Error_base: {
|
|
69
32
|
* - `message()` - a human-readable description of the error
|
70
33
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
71
34
|
*/
|
72
|
-
export declare class Error extends
|
35
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
36
|
+
constructor(_innerException: SdkError);
|
37
|
+
readonly type: CacheIncreaseTtlResponse.Error;
|
73
38
|
}
|
39
|
+
export type Response = Set | NotSet | Miss | Error;
|
74
40
|
export {};
|
@@ -1,54 +1,40 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Miss = exports.
|
3
|
+
exports.Error = exports.Miss = exports.NotSet = exports.Set = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
|
+
const enums_1 = require("./enums");
|
5
6
|
/**
|
6
|
-
*
|
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
|
-
* ```
|
7
|
+
* Indicates the ttl was successfully increased.
|
24
8
|
*/
|
25
|
-
class
|
26
|
-
|
27
|
-
|
28
|
-
|
9
|
+
class Set extends response_base_1.ResponseBase {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.type = enums_1.CacheIncreaseTtlResponse.Set;
|
13
|
+
}
|
29
14
|
}
|
15
|
+
exports.Set = Set;
|
30
16
|
/**
|
31
|
-
* Indicates
|
17
|
+
* Indicates the ttl was not updated due to a failed condition.
|
32
18
|
*/
|
33
|
-
class
|
34
|
-
|
35
|
-
|
36
|
-
|
19
|
+
class NotSet extends response_base_1.ResponseBase {
|
20
|
+
constructor() {
|
21
|
+
super(...arguments);
|
22
|
+
this.type = enums_1.CacheIncreaseTtlResponse.NotSet;
|
23
|
+
}
|
37
24
|
}
|
25
|
+
exports.NotSet = NotSet;
|
38
26
|
/**
|
39
|
-
* Indicates
|
27
|
+
* Indicates the requested item was not found in the cache.
|
40
28
|
*/
|
41
|
-
class Miss extends
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
constructor(_innerException) {
|
46
|
-
super();
|
47
|
-
this._innerException = _innerException;
|
29
|
+
class Miss extends response_base_1.BaseResponseMiss {
|
30
|
+
constructor() {
|
31
|
+
super(...arguments);
|
32
|
+
this.type = enums_1.CacheIncreaseTtlResponse.Miss;
|
48
33
|
}
|
49
34
|
}
|
35
|
+
exports.Miss = Miss;
|
50
36
|
/**
|
51
|
-
* Indicates that an error occurred during the increase
|
37
|
+
* Indicates that an error occurred during the increase ttl request.
|
52
38
|
*
|
53
39
|
* This response object includes the following fields that you can use to determine
|
54
40
|
* how you would like to handle the error:
|
@@ -57,7 +43,11 @@ class _Error extends Response {
|
|
57
43
|
* - `message()` - a human-readable description of the error
|
58
44
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
59
45
|
*/
|
60
|
-
class Error extends
|
46
|
+
class Error extends response_base_1.BaseResponseError {
|
47
|
+
constructor(_innerException) {
|
48
|
+
super(_innerException);
|
49
|
+
this.type = enums_1.CacheIncreaseTtlResponse.Error;
|
50
|
+
}
|
61
51
|
}
|
62
52
|
exports.Error = Error;
|
63
|
-
//# sourceMappingURL=data:application/json;base64,
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtdHRsLWluY3JlYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS10dGwtaW5jcmVhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBSXlCO0FBQ3pCLG1DQUFpRDtBQU1qRDs7R0FFRztBQUNILE1BQWEsR0FBSSxTQUFRLDRCQUFZO0lBQXJDOztRQUNXLFNBQUksR0FBaUMsZ0NBQXdCLENBQUMsR0FBRyxDQUFDO0lBQzdFLENBQUM7Q0FBQTtBQUZELGtCQUVDO0FBRUQ7O0dBRUc7QUFDSCxNQUFhLE1BQU8sU0FBUSw0QkFBWTtJQUF4Qzs7UUFDVyxTQUFJLEdBQ1gsZ0NBQXdCLENBQUMsTUFBTSxDQUFDO0lBQ3BDLENBQUM7Q0FBQTtBQUhELHdCQUdDO0FBRUQ7O0dBRUc7QUFDSCxNQUFhLElBQUssU0FBUSxnQ0FBZ0I7SUFBMUM7O1FBQ1csU0FBSSxHQUFrQyxnQ0FBd0IsQ0FBQyxJQUFJLENBQUM7SUFDL0UsQ0FBQztDQUFBO0FBRkQsb0JBRUM7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFhLEtBQU0sU0FBUSxpQ0FBaUI7SUFDMUMsWUFBWSxlQUF5QjtRQUNuQyxLQUFLLENBQUMsZUFBZSxDQUFDLENBQUM7UU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lckV4Y2VwdGlvbik7XG4gIH1cblxuICByZWFkb25seSB0eXBlOiBDYWNoZUluY3JlYXNlVHRsUmVzcG9uc2UuRXJyb3IgPVxuICAgIENhY2hlSW5jcmVhc2VUdGxSZXNwb25zZS5FcnJvcjtcbn1cblxuZXhwb3J0IHR5cGUgUmVzcG9uc2UgPSBTZXQgfCBOb3RTZXQgfCBNaXNzIHwgRXJyb3I7XG4iXX0=
|
@@ -1,66 +1,23 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import { ResponseBase } from './response-base';
|
3
|
-
|
4
|
-
|
5
|
-
|
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 {
|
2
|
+
import { BaseResponseError, BaseResponseMiss, ResponseBase } from './response-base';
|
3
|
+
import { CacheUpdateTtlResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: CacheUpdateTtlResponse;
|
26
6
|
}
|
27
|
-
declare const Set_base: {
|
28
|
-
new (...args: any[]): {
|
29
|
-
readonly is_success: boolean;
|
30
|
-
};
|
31
|
-
} & typeof _Set;
|
32
7
|
/**
|
33
|
-
* Indicates
|
8
|
+
* Indicates the ttl was successfully overwritten.
|
34
9
|
*/
|
35
|
-
export declare class Set extends
|
10
|
+
export declare class Set extends ResponseBase implements IResponse {
|
11
|
+
readonly type: CacheUpdateTtlResponse.Set;
|
36
12
|
}
|
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
13
|
/**
|
45
|
-
* Indicates
|
14
|
+
* Indicates the requested item was not found in the cache.
|
46
15
|
*/
|
47
|
-
export declare class Miss extends
|
48
|
-
|
49
|
-
declare class _Error extends Response {
|
50
|
-
protected _innerException: SdkError;
|
51
|
-
constructor(_innerException: SdkError);
|
16
|
+
export declare class Miss extends BaseResponseMiss implements IResponse {
|
17
|
+
readonly type: CacheUpdateTtlResponse.Miss;
|
52
18
|
}
|
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
19
|
/**
|
63
|
-
* Indicates that an error occurred during the update
|
20
|
+
* Indicates that an error occurred during the update ttl request.
|
64
21
|
*
|
65
22
|
* This response object includes the following fields that you can use to determine
|
66
23
|
* how you would like to handle the error:
|
@@ -69,6 +26,9 @@ declare const Error_base: {
|
|
69
26
|
* - `message()` - a human-readable description of the error
|
70
27
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
71
28
|
*/
|
72
|
-
export declare class Error extends
|
29
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
30
|
+
constructor(_innerException: SdkError);
|
31
|
+
readonly type: CacheUpdateTtlResponse.Error;
|
73
32
|
}
|
33
|
+
export type Response = Set | Miss | Error;
|
74
34
|
export {};
|
@@ -1,54 +1,30 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Miss = exports.Set =
|
3
|
+
exports.Error = exports.Miss = exports.Set = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
|
+
const enums_1 = require("./enums");
|
5
6
|
/**
|
6
|
-
*
|
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
|
-
* ```
|
7
|
+
* Indicates the ttl was successfully overwritten.
|
24
8
|
*/
|
25
|
-
class
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
/**
|
31
|
-
* Indicates a successful update TTL request.
|
32
|
-
*/
|
33
|
-
class Set extends (0, response_base_1.ResponseSuccess)(_Set) {
|
9
|
+
class Set extends response_base_1.ResponseBase {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.type = enums_1.CacheUpdateTtlResponse.Set;
|
13
|
+
}
|
34
14
|
}
|
35
15
|
exports.Set = Set;
|
36
|
-
class _Miss extends Response {
|
37
|
-
}
|
38
16
|
/**
|
39
|
-
* Indicates
|
17
|
+
* Indicates the requested item was not found in the cache.
|
40
18
|
*/
|
41
|
-
class Miss extends
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
constructor(_innerException) {
|
46
|
-
super();
|
47
|
-
this._innerException = _innerException;
|
19
|
+
class Miss extends response_base_1.BaseResponseMiss {
|
20
|
+
constructor() {
|
21
|
+
super(...arguments);
|
22
|
+
this.type = enums_1.CacheUpdateTtlResponse.Miss;
|
48
23
|
}
|
49
24
|
}
|
25
|
+
exports.Miss = Miss;
|
50
26
|
/**
|
51
|
-
* Indicates that an error occurred during the update
|
27
|
+
* Indicates that an error occurred during the update ttl request.
|
52
28
|
*
|
53
29
|
* This response object includes the following fields that you can use to determine
|
54
30
|
* how you would like to handle the error:
|
@@ -57,7 +33,11 @@ class _Error extends Response {
|
|
57
33
|
* - `message()` - a human-readable description of the error
|
58
34
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
59
35
|
*/
|
60
|
-
class Error extends
|
36
|
+
class Error extends response_base_1.BaseResponseError {
|
37
|
+
constructor(_innerException) {
|
38
|
+
super(_innerException);
|
39
|
+
this.type = enums_1.CacheUpdateTtlResponse.Error;
|
40
|
+
}
|
61
41
|
}
|
62
42
|
exports.Error = Error;
|
63
|
-
//# sourceMappingURL=data:application/json;base64,
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtdHRsLXVwZGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtdHRsLXVwZGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFJeUI7QUFDekIsbUNBQStDO0FBTS9DOztHQUVHO0FBQ0gsTUFBYSxHQUFJLFNBQVEsNEJBQVk7SUFBckM7O1FBQ1csU0FBSSxHQUErQiw4QkFBc0IsQ0FBQyxHQUFHLENBQUM7SUFDekUsQ0FBQztDQUFBO0FBRkQsa0JBRUM7QUFFRDs7R0FFRztBQUNILE1BQWEsSUFBSyxTQUFRLGdDQUFnQjtJQUExQzs7UUFDVyxTQUFJLEdBQWdDLDhCQUFzQixDQUFDLElBQUksQ0FBQztJQUMzRSxDQUFDO0NBQUE7QUFGRCxvQkFFQztBQUVEOzs7Ozs7Ozs7R0FTRztBQUNILE1BQWEsS0FBTSxTQUFRLGlDQUFpQjtJQUMxQyxZQ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
import { ResponseBase } from './response-base';
|
2
|
+
import { BaseResponseError, BaseResponseSuccess, ResponseBase } from './response-base';
|
3
|
+
import { CreateCacheResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: CreateCacheResponse;
|
6
|
+
}
|
3
7
|
/**
|
4
|
-
*
|
5
|
-
* response object is resolved to a type-safe object of one of
|
6
|
-
* the following subtypes:
|
7
|
-
*
|
8
|
-
* - {Success}
|
9
|
-
* - {AlreadyExists}
|
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 CreateCache.Error) {
|
17
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
18
|
-
* // `CreateCache.Error` in this block, so you will have access to the properties
|
19
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
20
|
-
* }
|
21
|
-
* ```
|
8
|
+
* Indicates a successful create cache request.
|
22
9
|
*/
|
23
|
-
export declare
|
10
|
+
export declare class Success extends BaseResponseSuccess implements IResponse {
|
11
|
+
readonly type: CreateCacheResponse.Success;
|
24
12
|
}
|
25
|
-
declare class _Success extends Response {
|
26
|
-
}
|
27
|
-
declare const Success_base: {
|
28
|
-
new (...args: any[]): {
|
29
|
-
readonly is_success: boolean;
|
30
|
-
};
|
31
|
-
} & typeof _Success;
|
32
13
|
/**
|
33
|
-
* Indicates
|
14
|
+
* Indicates that the cache already exists and no new cache was created.
|
34
15
|
*/
|
35
|
-
export declare class
|
36
|
-
|
37
|
-
declare class _Error extends Response {
|
38
|
-
protected _innerException: SdkError;
|
39
|
-
constructor(_innerException: SdkError);
|
16
|
+
export declare class AlreadyExists extends ResponseBase implements IResponse {
|
17
|
+
readonly type: CreateCacheResponse.AlreadyExists;
|
40
18
|
}
|
41
|
-
declare const Error_base: {
|
42
|
-
new (...args: any[]): {
|
43
|
-
_innerException: SdkError;
|
44
|
-
message(): string;
|
45
|
-
/**
|
46
|
-
* Indicates that an error occurred during the create cache request.
|
47
|
-
*
|
48
|
-
* This response object includes the following fields that you can use to determine
|
49
|
-
* how you would like to handle the error:
|
50
|
-
*
|
51
|
-
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
52
|
-
* - `message()` - a human-readable description of the error
|
53
|
-
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
54
|
-
*/
|
55
|
-
innerException(): SdkError;
|
56
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
57
|
-
toString(): string;
|
58
|
-
};
|
59
|
-
} & typeof _Error;
|
60
19
|
/**
|
61
20
|
* Indicates that an error occurred during the create cache request.
|
62
21
|
*
|
@@ -67,11 +26,9 @@ declare const Error_base: {
|
|
67
26
|
* - `message()` - a human-readable description of the error
|
68
27
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
69
28
|
*/
|
70
|
-
export declare class Error extends
|
71
|
-
|
72
|
-
|
73
|
-
* Indicates that the cache already exists, so there was nothing to do.
|
74
|
-
*/
|
75
|
-
export declare class AlreadyExists extends Response {
|
29
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
30
|
+
constructor(_innerException: SdkError);
|
31
|
+
readonly type: CreateCacheResponse.Error;
|
76
32
|
}
|
33
|
+
export type Response = Success | AlreadyExists | Error;
|
77
34
|
export {};
|