@gomomento/sdk-core 1.87.0 → 1.89.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 +2 -2
- package/dist/src/clients/ICacheClient.js +1 -1
- package/dist/src/clients/IMomentoCache.d.ts +2 -2
- package/dist/src/clients/IMomentoCache.js +1 -1
- package/dist/src/errors/errors.js +1 -1
- package/dist/src/internal/clients/cache/IDataClient.d.ts +2 -2
- package/dist/src/internal/clients/cache/IDataClient.js +1 -1
- 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 -48
- 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 +5 -5
- package/dist/src/messages/responses/cache-dictionary-fetch.js +4 -4
- package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +5 -5
- package/dist/src/messages/responses/cache-dictionary-get-field.js +4 -4
- package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +5 -5
- package/dist/src/messages/responses/cache-dictionary-get-fields.js +4 -4
- 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 +1 -1
- package/dist/src/messages/responses/cache-get.js +1 -1
- 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 -56
- 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 -66
- 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 -43
- 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 -54
- 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 +4 -4
- package/dist/src/messages/responses/cache-set.js +3 -3
- package/dist/src/messages/responses/cache-sorted-set-fetch.d.ts +19 -55
- package/dist/src/messages/responses/cache-sorted-set-fetch.js +23 -46
- package/dist/src/messages/responses/cache-sorted-set-get-rank.d.ts +19 -53
- package/dist/src/messages/responses/cache-sorted-set-get-rank.js +22 -39
- package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +28 -66
- package/dist/src/messages/responses/cache-sorted-set-get-score.js +32 -60
- package/dist/src/messages/responses/cache-sorted-set-get-scores.d.ts +21 -58
- package/dist/src/messages/responses/cache-sorted-set-get-scores.js +29 -52
- package/dist/src/messages/responses/cache-sorted-set-increment-score.d.ts +14 -46
- package/dist/src/messages/responses/cache-sorted-set-increment-score.js +14 -41
- package/dist/src/messages/responses/cache-sorted-set-length-by-score.d.ts +18 -53
- package/dist/src/messages/responses/cache-sorted-set-length-by-score.js +23 -40
- package/dist/src/messages/responses/cache-sorted-set-length.d.ts +19 -53
- package/dist/src/messages/responses/cache-sorted-set-length.js +22 -39
- package/dist/src/messages/responses/cache-sorted-set-put-element.d.ts +10 -43
- package/dist/src/messages/responses/cache-sorted-set-put-element.js +13 -34
- package/dist/src/messages/responses/cache-sorted-set-put-elements.d.ts +10 -43
- package/dist/src/messages/responses/cache-sorted-set-put-elements.js +13 -34
- package/dist/src/messages/responses/cache-sorted-set-remove-element.d.ts +10 -43
- package/dist/src/messages/responses/cache-sorted-set-remove-element.js +13 -34
- package/dist/src/messages/responses/cache-sorted-set-remove-elements.d.ts +10 -43
- package/dist/src/messages/responses/cache-sorted-set-remove-elements.js +13 -34
- 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 -48
- 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 +6 -0
- package/dist/src/messages/responses/enums/cache/index.js +23 -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/cache/sorted-set/index.d.ts +50 -0
- package/dist/src/messages/responses/enums/cache/sorted-set/index.js +65 -0
- package/dist/src/messages/responses/enums/index.d.ts +4 -24
- package/dist/src/messages/responses/enums/index.js +19 -31
- 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 +6 -0
- package/dist/src/messages/responses/response-base.js +9 -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/list-webhooks.d.ts +1 -10
- package/package.json +1 -1
@@ -1,12 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Success =
|
3
|
+
exports.Error = exports.Success = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
|
+
const enums_1 = require("./enums");
|
5
6
|
const utils_1 = require("../../internal/utils");
|
6
|
-
class
|
7
|
-
}
|
8
|
-
exports.Response = Response;
|
9
|
-
class _Success extends Response {
|
7
|
+
class Success extends response_base_1.BaseResponseSuccess {
|
10
8
|
/**
|
11
9
|
* @deprecated Use `apiKey` instead.
|
12
10
|
* @returns {string}
|
@@ -16,24 +14,14 @@ class _Success extends Response {
|
|
16
14
|
}
|
17
15
|
constructor(apiKey, refreshToken, endpoint, expiresAt) {
|
18
16
|
super();
|
17
|
+
this.type = enums_1.RefreshApiKeyResponse.Success;
|
19
18
|
this.apiKey = (0, utils_1.encodeToBase64)(JSON.stringify({ endpoint: endpoint, api_key: apiKey }));
|
20
19
|
this.refreshToken = refreshToken;
|
21
20
|
this.endpoint = endpoint;
|
22
21
|
this.expiresAt = expiresAt;
|
23
22
|
}
|
24
23
|
}
|
25
|
-
/**
|
26
|
-
* Indicates a Successful generate api token request.
|
27
|
-
*/
|
28
|
-
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
29
|
-
}
|
30
24
|
exports.Success = Success;
|
31
|
-
class _Error extends Response {
|
32
|
-
constructor(_innerException) {
|
33
|
-
super();
|
34
|
-
this._innerException = _innerException;
|
35
|
-
}
|
36
|
-
}
|
37
25
|
/**
|
38
26
|
* Indicates that an error occurred during the generate api token request.
|
39
27
|
*
|
@@ -44,7 +32,11 @@ class _Error extends Response {
|
|
44
32
|
* - `message()` - a human-readable description of the error
|
45
33
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
46
34
|
*/
|
47
|
-
class Error extends
|
35
|
+
class Error extends response_base_1.BaseResponseError {
|
36
|
+
constructor(innerException) {
|
37
|
+
super(innerException);
|
38
|
+
this.type = enums_1.RefreshApiKeyResponse.Error;
|
39
|
+
}
|
48
40
|
}
|
49
41
|
exports.Error = Error;
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVmcmVzaC1hcGkta2V5LmpzIiwic291cmNlUm9vdCI6Ii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VJlc3BvbnNlRXJyb3IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICBjb25zdHJ1Y3Rvcihpbm5lckV4Y2VwdGlvbjogU2RrRXJyb3IpIHtcbiAgICBzdXBlcihpbm5lckV4Y2VwdGlvbik7XG4gIH1cblxuICByZWFkb25seSB0eXBlOiBSZWZyZXNoQXBpS2V5UmVzcG9uc2UuRXJyb3IgPSBSZWZyZXNoQXBpS2V5UmVzcG9uc2UuRXJyb3I7XG59XG5cbmV4cG9ydCB0eXBlIFJlc3BvbnNlID0gU3VjY2VzcyB8IEVycm9yO1xuIl19
|
@@ -18,6 +18,9 @@ export interface IResponseMiss {
|
|
18
18
|
export interface IListResponseSuccess {
|
19
19
|
listLength(): number;
|
20
20
|
}
|
21
|
+
export interface IResponseSubscription {
|
22
|
+
is_subscribed: boolean;
|
23
|
+
}
|
21
24
|
export declare abstract class BaseResponseError extends ResponseBase {
|
22
25
|
_innerException: SdkError;
|
23
26
|
protected constructor(innerException: SdkError);
|
@@ -49,6 +52,9 @@ export declare function ResponseMiss<TBase extends Constructor>(Base: TBase): {
|
|
49
52
|
export declare abstract class BaseResponseSuccess extends ResponseBase {
|
50
53
|
readonly is_success: boolean;
|
51
54
|
}
|
55
|
+
export declare abstract class BaseResponseSubscription extends ResponseBase {
|
56
|
+
readonly is_subscribed: boolean;
|
57
|
+
}
|
52
58
|
export declare function ResponseSuccess<TBase extends Constructor>(Base: TBase): {
|
53
59
|
new (...args: any[]): {
|
54
60
|
readonly is_success: boolean;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ResponseNotFound = exports.ResponseFound = exports.ResponseSuccess = exports.BaseResponseSuccess = exports.ResponseMiss = exports.BaseResponseMiss = exports.ResponseHit = exports.ResponseError = exports.BaseResponseError = exports.ResponseBase = void 0;
|
3
|
+
exports.ResponseNotFound = exports.ResponseFound = exports.ResponseSuccess = exports.BaseResponseSubscription = exports.BaseResponseSuccess = exports.ResponseMiss = exports.BaseResponseMiss = exports.ResponseHit = exports.ResponseError = exports.BaseResponseError = exports.ResponseBase = void 0;
|
4
4
|
class ResponseBase {
|
5
5
|
toString() {
|
6
6
|
return this.constructor.name;
|
@@ -71,6 +71,13 @@ class BaseResponseSuccess extends ResponseBase {
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
exports.BaseResponseSuccess = BaseResponseSuccess;
|
74
|
+
class BaseResponseSubscription extends ResponseBase {
|
75
|
+
constructor() {
|
76
|
+
super(...arguments);
|
77
|
+
this.is_subscribed = true;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
exports.BaseResponseSubscription = BaseResponseSubscription;
|
74
81
|
function ResponseSuccess(Base) {
|
75
82
|
return class ResponseSuccess extends Base {
|
76
83
|
constructor() {
|
@@ -90,4 +97,4 @@ function ResponseNotFound(Base) {
|
|
90
97
|
};
|
91
98
|
}
|
92
99
|
exports.ResponseNotFound = ResponseNotFound;
|
93
|
-
//# sourceMappingURL=data:application/json;base64,
|
100
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzcG9uc2UtYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvcmVzcG9uc2UtYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSxNQUFzQixZQUFZO0lBQ3pCLFFBQVE7UUFDYixPQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDO0lBQy9CLENBQUM7Q0FDRjtBQUpELG9DQUlDO0FBK0JELE1BQXNCLGlCQUFrQixTQUFRLFlBQVk7SUFHMUQsWUFBc0IsY0FBd0I7UUFDNUMsS0FBSyxFQUFFLENBQUM7UUFDUixJQUFJLENBQUMsZUFBZSxHQUFHLGNBQWMsQ0FBQztJQUN4QyxDQUF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0ZW5kcyBSZXNwb25zZUJhc2Uge1xuICBwdWJsaWMgcmVhZG9ubHkgaXNfc3Vic2NyaWJlZDogYm9vbGVhbiA9IHRydWU7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBSZXNwb25zZVN1Y2Nlc3M8VEJhc2UgZXh0ZW5kcyBDb25zdHJ1Y3Rvcj4oQmFzZTogVEJhc2UpIHtcbiAgcmV0dXJuIGNsYXNzIFJlc3BvbnNlU3VjY2VzcyBleHRlbmRzIEJhc2Uge1xuICAgIHB1YmxpYyByZWFkb25seSBpc19zdWNjZXNzOiBib29sZWFuID0gdHJ1ZTtcbiAgfTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIFJlc3BvbnNlRm91bmQ8VEJhc2UgZXh0ZW5kcyBDb25zdHJ1Y3Rvcj4oQmFzZTogVEJhc2UpIHtcbiAgcmV0dXJuIGNsYXNzIFJlc3BvbnNlRm91bmQgZXh0ZW5kcyBCYXNlIHt9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gUmVzcG9uc2VOb3RGb3VuZDxUQmFzZSBleHRlbmRzIENvbnN0cnVjdG9yPihCYXNlOiBUQmFzZSkge1xuICByZXR1cm4gY2xhc3MgUmVzcG9uc2VOb3RGb3VuZCBleHRlbmRzIEJhc2Uge307XG59XG4iXX0=
|
@@ -1,51 +1,15 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
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 TopicPublish.Error) {
|
16
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
-
* // `TopicPublish.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 {
|
2
|
+
import { BaseResponseError, BaseResponseSuccess } from './response-base';
|
3
|
+
import { TopicPublishResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: TopicPublishResponse;
|
23
6
|
}
|
24
|
-
declare class _Success extends Response {
|
25
|
-
}
|
26
|
-
declare const Success_base: {
|
27
|
-
new (...args: any[]): {
|
28
|
-
readonly is_success: boolean;
|
29
|
-
};
|
30
|
-
} & typeof _Success;
|
31
7
|
/**
|
32
8
|
* Indicates a Successful cache set request.
|
33
9
|
*/
|
34
|
-
export declare class Success extends
|
35
|
-
|
36
|
-
declare class _Error extends Response {
|
37
|
-
protected _innerException: SdkError;
|
38
|
-
constructor(_innerException: SdkError);
|
10
|
+
export declare class Success extends BaseResponseSuccess implements IResponse {
|
11
|
+
readonly type: TopicPublishResponse.Success;
|
39
12
|
}
|
40
|
-
declare const Error_base: {
|
41
|
-
new (...args: any[]): {
|
42
|
-
_innerException: SdkError;
|
43
|
-
message(): string;
|
44
|
-
innerException(): SdkError;
|
45
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
46
|
-
toString(): string;
|
47
|
-
};
|
48
|
-
} & typeof _Error;
|
49
13
|
/**
|
50
14
|
* Indicates that an error occurred during the cache set request.
|
51
15
|
*
|
@@ -56,6 +20,9 @@ declare const Error_base: {
|
|
56
20
|
* - `message()` - a human-readable description of the error
|
57
21
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
58
22
|
*/
|
59
|
-
export declare class Error extends
|
23
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
24
|
+
readonly type: TopicPublishResponse.Error;
|
25
|
+
constructor(_innerException: SdkError);
|
60
26
|
}
|
27
|
+
export type Response = Success | Error;
|
61
28
|
export {};
|
@@ -1,43 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Success =
|
3
|
+
exports.Error = exports.Success = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
|
-
|
6
|
-
* Parent response type for a topic publish 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 TopicPublish.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `TopicPublish.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
|
-
}
|
5
|
+
const enums_1 = require("./enums");
|
29
6
|
/**
|
30
7
|
* Indicates a Successful cache set request.
|
31
8
|
*/
|
32
|
-
class Success extends
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
constructor(_innerException) {
|
37
|
-
super();
|
38
|
-
this._innerException = _innerException;
|
9
|
+
class Success extends response_base_1.BaseResponseSuccess {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.type = enums_1.TopicPublishResponse.Success;
|
39
13
|
}
|
40
14
|
}
|
15
|
+
exports.Success = Success;
|
41
16
|
/**
|
42
17
|
* Indicates that an error occurred during the cache set request.
|
43
18
|
*
|
@@ -48,7 +23,11 @@ class _Error extends Response {
|
|
48
23
|
* - `message()` - a human-readable description of the error
|
49
24
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
50
25
|
*/
|
51
|
-
class Error extends
|
26
|
+
class Error extends response_base_1.BaseResponseError {
|
27
|
+
constructor(_innerException) {
|
28
|
+
super(_innerException);
|
29
|
+
this.type = enums_1.TopicPublishResponse.Error;
|
30
|
+
}
|
52
31
|
}
|
53
32
|
exports.Error = Error;
|
54
|
-
//# sourceMappingURL=data:application/json;base64,
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWMtcHVibGlzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvdG9waWMtcHVibGlzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBdUU7QUFDdkUsbUNBQTZDO0FBTTdDOztHQUVHO0FBQ0gsTUFBYSxPQUFRLFNBQVEsbUNBQW1CO0lBQWhEOztRQUNXLFNBQUksR0FBaUMsNEJBQW9CLENBQUMsT0FBTyxDQUFDO0lBQzdFLENBQUM7Q0FBQTtBQUZELDBCQUVDO0FBRUQ7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBYSxLQUFNLFNBQVEsaUNBQWlCO0lBRTFDLFlBQVksZUFBeUI7UUFDbkMsS0FBSyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBRmhCLFNBQUksR0FBK0IsNEJBQW9CLENBQUMsS0FBSyxDQUFDO0lBR3ZFLENBQUM7Q0FDRjtBQUxELHNCQUtDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtTZGtFcnJvcn0gZnJvbSAnLi4vLi4vZXJyb3JzJztcbmltcG9ydCB7QmFzZVJlc3BvbnNlRXJyb3IsIEJhc2VSZXNwb25zZVN1Y2Nlc3N9IGZyb20gJy4vcmVzcG9uc2UtYmFzZSc7XG5pbXBvcnQge1RvcGljUHVibGlzaFJlc3BvbnNlfSBmcm9tICcuL2VudW1zJztcblxuaW50ZXJmYWNlIElSZXNwb25zZSB7XG4gIHJlYWRvbmx5IHR5cGU6IFRvcGljUHVibGlzaFJlc3BvbnNlO1xufVxuXG4vKipcbiAqIEluZGljYXRl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I7XG4gIGNvbnN0cnVjdG9yKF9pbm5lckV4Y2VwdGlvbjogU2RrRXJyb3IpIHtcbiAgICBzdXBlcihfaW5uZXJFeGNlcHRpb24pO1xuICB9XG59XG5cbmV4cG9ydCB0eXBlIFJlc3BvbnNlID0gU3VjY2VzcyB8IEVycm9yO1xuIl19
|
@@ -1,27 +1,9 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import {
|
2
|
+
import { BaseResponseError, BaseResponseSubscription } from './response-base';
|
3
3
|
import { SubscriptionState } from '../../internal/subscription-state';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
* the following subtypes:
|
8
|
-
*
|
9
|
-
* - {Subscription}
|
10
|
-
* - {Item}
|
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 TopicSubscribe.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `CacheGet.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
|
-
export declare abstract class Response extends ResponseBase {
|
4
|
+
import { TopicSubscribeResponse } from './enums';
|
5
|
+
interface IResponse {
|
6
|
+
readonly type: TopicSubscribeResponse;
|
25
7
|
}
|
26
8
|
/**
|
27
9
|
* Encapsulates a topic subscription.
|
@@ -30,8 +12,9 @@ export declare abstract class Response extends ResponseBase {
|
|
30
12
|
* In the future, this may be extended to include additional
|
31
13
|
* statistics about the subscription.
|
32
14
|
*/
|
33
|
-
export declare class Subscription extends
|
15
|
+
export declare class Subscription extends BaseResponseSubscription implements IResponse {
|
34
16
|
private subscriptionState;
|
17
|
+
readonly type: TopicSubscribeResponse.Subscription;
|
35
18
|
constructor(subscriptionState: SubscriptionState);
|
36
19
|
/**
|
37
20
|
* Unsubscribes from the topic.
|
@@ -41,19 +24,6 @@ export declare class Subscription extends Response {
|
|
41
24
|
unsubscribe(): void;
|
42
25
|
get isSubscribed(): boolean;
|
43
26
|
}
|
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
27
|
/**
|
58
28
|
* Indicates that an error occurred during the topic subscribe request.
|
59
29
|
*
|
@@ -64,6 +34,9 @@ declare const Error_base: {
|
|
64
34
|
* - `message()` - a human-readable description of the error
|
65
35
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
66
36
|
*/
|
67
|
-
export declare class Error extends
|
37
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
38
|
+
readonly type: TopicSubscribeResponse.Error;
|
39
|
+
constructor(_innerException: SdkError);
|
68
40
|
}
|
41
|
+
export type Response = Subscription | Error;
|
69
42
|
export {};
|
@@ -1,30 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Subscription =
|
3
|
+
exports.Error = exports.Subscription = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
|
-
|
6
|
-
* Parent response type for a cache get request. The
|
7
|
-
* response object is resolved to a type-safe object of one of
|
8
|
-
* the following subtypes:
|
9
|
-
*
|
10
|
-
* - {Subscription}
|
11
|
-
* - {Item}
|
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 TopicSubscribe.Error) {
|
19
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
20
|
-
* // `CacheGet.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;
|
5
|
+
const enums_1 = require("./enums");
|
28
6
|
/**
|
29
7
|
* Encapsulates a topic subscription.
|
30
8
|
*
|
@@ -32,9 +10,10 @@ exports.Response = Response;
|
|
32
10
|
* In the future, this may be extended to include additional
|
33
11
|
* statistics about the subscription.
|
34
12
|
*/
|
35
|
-
class Subscription extends
|
13
|
+
class Subscription extends response_base_1.BaseResponseSubscription {
|
36
14
|
constructor(subscriptionState) {
|
37
15
|
super();
|
16
|
+
this.type = enums_1.TopicSubscribeResponse.Subscription;
|
38
17
|
this.subscriptionState = subscriptionState;
|
39
18
|
}
|
40
19
|
/**
|
@@ -50,12 +29,6 @@ class Subscription extends Response {
|
|
50
29
|
}
|
51
30
|
}
|
52
31
|
exports.Subscription = Subscription;
|
53
|
-
class _Error extends Response {
|
54
|
-
constructor(_innerException) {
|
55
|
-
super();
|
56
|
-
this._innerException = _innerException;
|
57
|
-
}
|
58
|
-
}
|
59
32
|
/**
|
60
33
|
* Indicates that an error occurred during the topic subscribe request.
|
61
34
|
*
|
@@ -66,7 +39,11 @@ class _Error extends Response {
|
|
66
39
|
* - `message()` - a human-readable description of the error
|
67
40
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
68
41
|
*/
|
69
|
-
class Error extends
|
42
|
+
class Error extends response_base_1.BaseResponseError {
|
43
|
+
constructor(_innerException) {
|
44
|
+
super(_innerException);
|
45
|
+
this.type = enums_1.TopicSubscribeResponse.Error;
|
46
|
+
}
|
70
47
|
}
|
71
48
|
exports.Error = Error;
|
72
|
-
//# sourceMappingURL=data:application/json;base64,
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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mVzcG9uc2UuRXJyb3IgPSBUb3BpY1N1YnNjcmliZVJlc3BvbnNlLkVycm9yO1xuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBSZXNwb25zZSA9IFN1YnNjcmlwdGlvbiB8IEVycm9yO1xuIl19
|
@@ -48,16 +48,7 @@ declare class _Error extends Response {
|
|
48
48
|
}
|
49
49
|
declare const Error_base: {
|
50
50
|
new (...args: any[]): {
|
51
|
-
_innerException: SdkError;
|
52
|
-
* Indicates that an error occurred during the list webhooks request.
|
53
|
-
*
|
54
|
-
* This response object includes the following fields that you can use to determine
|
55
|
-
* how you would like to handle the error:
|
56
|
-
*
|
57
|
-
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
58
|
-
* - `message()` - a human-readable description of the error
|
59
|
-
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
60
|
-
*/
|
51
|
+
_innerException: SdkError;
|
61
52
|
message(): string;
|
62
53
|
innerException(): SdkError;
|
63
54
|
errorCode(): import("../../../errors").MomentoErrorCode;
|